Post data to jobs APIedit

Deprecated in 7.11.0.

Posting data directly to anomaly detection jobs is deprecated, in a future major version a datafeed will be required.

Sends data to an anomaly detection job for analysis.


POST _ml/anomaly_detectors/<job_id>/_data


Requires the manage_ml cluster privilege. This privilege is included in the machine_learning_admin built-in role.


The job must have a state of open to receive and process the data.

The data that you send to the job must use the JSON format. Multiple JSON documents can be sent, either adjacent with no separator in between them or whitespace separated. Newline delimited JSON (NDJSON) is a possible whitespace separated format, and for this the Content-Type header should be set to application/x-ndjson.

Upload sizes are limited to the Elasticsearch HTTP receive buffer size (default 100 Mb). If your data is larger, split it into multiple chunks and upload each one separately in sequential time order. When running in real time, it is generally recommended that you perform many small uploads, rather than queueing data to upload larger files.

When uploading data, check the job data counts for progress. The following documents will not be processed:

  • Documents not in chronological order and outside the latency window
  • Records with an invalid timestamp

For each job, data can only be accepted from a single connection at a time. It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.

Path parametersedit

(Required, string) Identifier for the anomaly detection job.

Query parametersedit

(Optional, string) Specifies the start of the bucket resetting range.
(Optional, string) Specifies the end of the bucket resetting range.

Request bodyedit

A sequence of one or more JSON documents containing the data to be analyzed. Only whitespace characters are permitted in between the documents.


The following example posts data from the it_ops_new_kpi.json file to the it_ops_new_kpi job:

$ curl -s -H "Content-type: application/json"
-X POST http:\/\/localhost:9200/_ml/anomaly_detectors/it_ops_new_kpi/_data
--data-binary @it_ops_new_kpi.json

When the data is sent, you receive information about the operational progress of the job. For example:


For more information about these properties, see Response body.