Get anomaly records for an anomaly detection job
Generally available; Added in 5.4.0
Records contain the detailed analytical results. They describe the anomalous activity that has been identified in the input data based on the detector configuration. There can be many anomaly records depending on the characteristics and size of the input data. In practice, there are often too many to be able to manually process them. The machine learning features therefore perform a sophisticated aggregation of the anomaly records into buckets. The number of record results depends on the number of anomalies found in each bucket, which relates to the number of time series being modeled and the number of detectors.
Required authorization
- Cluster privileges:
monitor_ml
Query parameters
-
If true, the results are sorted in descending order.
-
Returns records with timestamps earlier than this time. The default value means results are not limited to specific timestamps.
-
If
true
, the output excludes interim results. -
Skips the specified number of records.
-
Returns records with anomaly scores greater or equal than this value.
-
Specifies the maximum number of records to obtain.
-
Specifies the sort field for the requested records.
-
Returns records with timestamps after this time. The default value means results are not limited to specific timestamps.
Body
-
Refer to the description for the
desc
query parameter. -
Refer to the description for the
exclude_interim
query parameter. -
Refer to the description for the
record_score
query parameter. -
Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
GET _ml/anomaly_detectors/low_request_rate/results/records
{
"sort": "record_score",
"desc": true,
"start": "1454944100000"
}
resp = client.ml.get_records(
job_id="low_request_rate",
sort="record_score",
desc=True,
start="1454944100000",
)
const response = await client.ml.getRecords({
job_id: "low_request_rate",
sort: "record_score",
desc: true,
start: 1454944100000,
});
response = client.ml.get_records(
job_id: "low_request_rate",
body: {
"sort": "record_score",
"desc": true,
"start": "1454944100000"
}
)
$resp = $client->ml()->getRecords([
"job_id" => "low_request_rate",
"body" => [
"sort" => "record_score",
"desc" => true,
"start" => "1454944100000",
],
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"sort":"record_score","desc":true,"start":"1454944100000"}' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/results/records"
{
"sort": "record_score",
"desc": true,
"start": "1454944100000"
}