Get data frame analytics jobs APIedit

Retrieves configuration information for data frame analytics jobs.

Requestedit

GET _ml/data_frame/analytics/<data_frame_analytics_id>

GET _ml/data_frame/analytics/<data_frame_analytics_id>,<data_frame_analytics_id>

GET _ml/data_frame/analytics/

GET _ml/data_frame/analytics/_all

Prerequisitesedit

Requires the monitor_ml cluster privilege. This privilege is included in the machine_learning_user built-in role.

Descriptionedit

You can get information for multiple data frame analytics jobs in a single API request by using a comma-separated list of data frame analytics jobs or a wildcard expression.

Path parametersedit

<data_frame_analytics_id>

(Optional, string) Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame analytics jobs.

You can get information for all data frame analytics jobs by using _all, by specifying * as the <data_frame_analytics_id>, or by omitting the <data_frame_analytics_id>.

Query parametersedit

allow_no_match

(Optional, Boolean) Specifies what to do when the request:

  • Contains wildcard expressions and there are no data frame analytics jobs that match.
  • Contains the _all string or no identifiers and there are no matches.
  • Contains wildcard expressions and there are only partial matches.

The default value is true, which returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

exclude_generated
(Optional, Boolean) Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster. Default is false.
from
(Optional, integer) Skips the specified number of data frame analytics jobs. The default value is 0.
size
(Optional, integer) Specifies the maximum number of data frame analytics jobs to obtain. The default value is 100.

Response bodyedit

data_frame_analytics

(array) An array of data frame analytics job resources, which are sorted by the id value in ascending order.

Properties of data frame analytics job resources
analysis
(object) The type of analysis that is performed on the source.
analyzed_fields

(object) Contains includes and/or excludes patterns that select which fields are included in the analysis.

Properties of analyzed_fields
excludes
(Optional, array) An array of strings that defines the fields that are excluded from the analysis.
includes
(Optional, array) An array of strings that defines the fields that are included in the analysis.
authorization

(object) The security privileges that the job uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the job, this property is omitted.

Properties of authorization
api_key

(object) If an API key was used for the most recent update to the job, its name and identifier are listed in the response.

Properties of api_key
id
(string) The identifier for the API key.
name
(string) The name of the API key.
roles
(array of strings) If a user ID was used for the most recent update to the job, its roles at the time of the update are listed in the response.
service_account
(string) If a service account was used for the most recent update to the job, the account name is listed in the response.
dest

(string) The destination configuration of the analysis.

Properties of dest
index
(string) The destination index that stores the results of the data frame analytics job.
results_field
(string) The name of the field that stores the results of the analysis. Defaults to ml.
id
(string) The unique identifier of the data frame analytics job.
model_memory_limit
(string) The model_memory_limit that has been set for the data frame analytics job.
source

(object) The configuration of how the analysis data is sourced. It has an index parameter and optionally a query and a _source.

Properties of source
index
(array) Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns.
query
(object) The query that has been specified for the data frame analytics job. The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. By default, this property has the following value: {"match_all": {}}.
_source

(object) Contains the specified includes and/or excludes patterns that select which fields are present in the destination. Fields that are excluded cannot be included in the analysis.

Properties of _source
excludes
(array) An array of strings that defines the fields that are excluded from the destination.
includes
(array) An array of strings that defines the fields that are included in the destination.

Response codesedit

404 (Missing resources)
If allow_no_match is false, this code indicates that there are no resources that match the request or only partial matches for the request.

Examplesedit

The following example gets configuration information for the loganalytics data frame analytics job:

GET _ml/data_frame/analytics/loganalytics

The API returns the following results:

{
  "count" : 1,
  "data_frame_analytics" : [
    {
      "id" : "loganalytics",
      "create_time" : 1656364565517,
      "version" : "8.4.0",
      "authorization" : {
        "roles" : [
          "superuser"
        ]
      },
      "description" : "Outlier detection on log data",
      "source" : {
        "index" : [
          "logdata"
        ],
        "query" : {
          "match_all" : { }
        }
      },
      "dest" : {
        "index" : "logdata_out",
        "results_field" : "ml"
      },
      "analysis" : {
        "outlier_detection" : {
          "compute_feature_influence" : true,
          "outlier_fraction" : 0.05,
          "standardization_enabled" : true
        }
      },
      "model_memory_limit" : "1gb",
      "allow_lazy_start" : false,
      "max_num_threads" : 1
    }
  ]
}