Get data frame analytics jobs API

Retrieves configuration information for data frame analytics jobs.

This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Request

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

Prerequisites

If the Elasticsearch security features are enabled, you must have the following privileges:

  • cluster: monitor_ml

For more information, see Security privileges and Machine learning security privileges.

Description

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 parameters

<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 parameters

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.

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 body

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.

  1. `dest`
  2. (string) The destination configuration of the analysis.
  3. Properties of `dest`
  4. - `index`
  5. (string) The *destination index* that stores the results of the data frame analytics job.
  6. `results_field`
  7. (string) The name of the field that stores the results of the analysis. Defaults to `ml`.
  8. `id`
  9. (string) The unique identifier of the data frame analytics job.
  10. `model_memory_limit`
  11. (string) The `model_memory_limit` that has been set to the data frame analytics job.
  12. `source`
  13. (object) The configuration of how the analysis data is sourced. It has an `index` parameter and optionally a `query` and a `_source`.
  14. Properties of `source`
  15. - `index`
  16. (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.
  17. `query`
  18. (object) The query that has been specified for the data frame analytics job. The Elasticsearch query domain-specific language ([DSL]($adeacfff22b20f2c.md "Query DSL")). This value corresponds to the query object in an Elasticsearch search POST body. By default, this property has the following value: `{"match_all": {}}`.
  19. `_source`
  20. (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.
  21. Properties of `_source`
  22. `excludes`
  23. (array) An array of strings that defines the fields that are excluded from the destination.
  24. `includes`
  25. (array) An array of strings that defines the fields that are included in the destination.

Response codes

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.

Examples

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

  1. GET _ml/data_frame/analytics/loganalytics

The API returns the following results:

  1. {
  2. "count": 1,
  3. "data_frame_analytics": [
  4. {
  5. "id": "loganalytics",
  6. "source": {
  7. "index": "logdata",
  8. "query": {
  9. "match_all": {}
  10. }
  11. },
  12. "dest": {
  13. "index": "logdata_out",
  14. "results_field": "ml"
  15. },
  16. "analysis": {
  17. "outlier_detection": {}
  18. },
  19. "model_memory_limit": "1gb",
  20. "create_time": 1562265491319,
  21. "version": "8.0.0"
  22. }
  23. ]
  24. }