Preview a datafeed

  • POST also GET /_ml/datafeeds/{datafeed_id}/_preview
  • POST also GET /_ml/datafeeds/_preview
Auth

This API returns the first "page" of search results from a datafeed. You can preview an existing datafeed or provide configuration details for a datafeed and anomaly detection job in the API. The preview shows the structure of the data that will be passed to the anomaly detection engine. IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials. You can also use secondary authorization headers to supply the credentials.

Required privileges

Index privileges read
Cluster privileges manage_ml

Path parameters

datafeed_id string optional

A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. NOTE: If you use this path parameter, you cannot provide datafeed or anomaly detection job configuration details in the request body.

Leave it out to use /_ml/datafeeds/_preview.

Query parameters

start union oneOf

The start time from where the datafeed preview should begin

One of: string or number
end union oneOf

The end time when the datafeed preview should stop

One of: string or number

Request body

Response

application/json

Response Type: object[]