Type to search.

Get anomaly records for an anomaly detection job

  • POST also GET /_ml/anomaly_detectors/{job_id}/results/records
Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 5.4 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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 privileges

Cluster privileges monitor_ml

Path parameters

job_id string required

Identifier for the anomaly detection job.

Query parameters

desc boolean · default: false

If true, the results are sorted in descending order.

end union oneOf · default: -1

Returns records with timestamps earlier than this time. The default value means results are not limited to specific timestamps.

One of: string or number
exclude_interim boolean · default: false

If true, the output excludes interim results.

from number · default: 0

Skips the specified number of records.

record_score number · default: 0

Returns records with anomaly scores greater or equal than this value.

size number · default: 100

Specifies the maximum number of records to obtain.

sort string · default: record_score

Specifies the sort field for the requested records.

start union oneOf · default: -1

Returns records with timestamps after this time. The default value means results are not limited to specific timestamps.

One of: string or number

Request body

desc boolean · default: false

Refer to the description for the desc query parameter.

end union oneOf · default: -1

Refer to the description for the end query parameter.

One of: string or number
exclude_interim boolean · default: false

Refer to the description for the exclude_interim query parameter.

record_score number · default: 0

Refer to the description for the record_score query parameter.

sort string · default: record_score

Refer to the description for the sort query parameter.

start union oneOf · default: -1

Refer to the description for the start query parameter.

One of: string or number

Response

application/json
count number required
records object[] required
actual number[]

The actual value for the bucket.

bucket_span number required

The length of the bucket in seconds. This value matches the bucket_span that is specified in the job.

by_field_name string

The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split.

by_field_value string

The value of by_field_name.

detector_index number required

A unique identifier for the detector.

field_name string

Certain functions require a field to operate on, for example, sum(). For those functions, this value is the name of the field to be analyzed.

function string

The function in which the anomaly occurs, as specified in the detector configuration. For example, max.

function_description string

The description of the function in which the anomaly occurs, as specified in the detector configuration.

initial_record_score number required

A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed.

is_interim boolean required

If true, this is an interim result. In other words, the results are calculated based on partial input data.

job_id string required

Identifier for the anomaly detection job.

over_field_name string

The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.

over_field_value string

The value of over_field_name.

partition_field_name string

The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.

partition_field_value string

The value of partition_field_name.

probability number required

The probability of the individual anomaly occurring, in the range 0 to 1. For example, 0.0000772031. This value can be held to a high precision of over 300 decimal places, so the record_score is provided as a human-readable and friendly interpretation of this.

record_score number required

A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike initial_record_score, this value will be updated by a re-normalization process as new data is analyzed.

result_type string required

Internal. This is always set to record.

timestamp number required

The start time of the bucket for which these results were calculated.

typical number[]

The typical value for the bucket, according to analytical modeling.