Get anomaly detection jobs API

Retrieves configuration information for anomaly detection jobs.

Request

GET _ml/anomaly_detectors/<job_id>

GET _ml/anomaly_detectors/<job_id>,<job_id>

GET _ml/anomaly_detectors/

GET _ml/anomaly_detectors/_all

Prerequisites

Description

You can get information for multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can get information for all anomaly detection jobs by using _all, by specifying * as the <job_id>, or by omitting the <job_id>.

This API returns a maximum of 10,000 jobs.

Path parameters

<job_id>

(Optional, string) Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these options, the API returns information for all anomaly detection jobs.

Query parameters

allow_no_jobs

(Optional, boolean) Specifies what to do when the request:

  • Contains wildcard expressions and there are no 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 jobs 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.

Response body

The API returns an array of anomaly detection job resources. For the full list of properties, see create anomaly detection jobs API.

create_time

(string) The time the job was created. For example, 1491007356077. This property is informational; you cannot change its value.

finished_time

(string) If the job closed or failed, this is the time the job finished. Otherwise, it is null. This property is informational; you cannot change its value.

job_type

(string) Reserved for future use, currently set to anomaly_detector.

job_version

(string) The version of Elasticsearch that existed on the node when the job was created.

model_snapshot_id

(string) A numerical character string that uniquely identifies the model snapshot.

Response codes

404 (Missing resources)

If allow_no_jobs is false, this code indicates that there are no resources that match the request or only partial matches for the request.

Examples

  1. GET _ml/anomaly_detectors/high_sum_total_sales

The API returns the following results:

  1. {
  2. "count": 1,
  3. "jobs": [
  4. {
  5. "job_id" : "high_sum_total_sales",
  6. "job_type" : "anomaly_detector",
  7. "job_version" : "7.5.0",
  8. "groups" : [
  9. "kibana_sample_data",
  10. "kibana_sample_ecommerce"
  11. ],
  12. "description" : "Find customers spending an unusually high amount in an hour",
  13. "create_time" : 1577221534700,
  14. "analysis_config" : {
  15. "bucket_span" : "1h",
  16. "detectors" : [
  17. {
  18. "detector_description" : "High total sales",
  19. "function" : "high_sum",
  20. "field_name" : "taxful_total_price",
  21. "over_field_name" : "customer_full_name.keyword",
  22. "detector_index" : 0
  23. }
  24. ],
  25. "influencers" : [
  26. "customer_full_name.keyword",
  27. "category.keyword"
  28. ]
  29. },
  30. "analysis_limits" : {
  31. "model_memory_limit" : "10mb",
  32. "categorization_examples_limit" : 4
  33. },
  34. "data_description" : {
  35. "time_field" : "order_date",
  36. "time_format" : "epoch_ms"
  37. },
  38. "model_plot_config" : {
  39. "enabled" : true
  40. },
  41. "model_snapshot_retention_days" : 10,
  42. "daily_model_snapshot_retention_after_days" : 1,
  43. "custom_settings" : {
  44. "created_by" : "ml-module-sample",
  45. ...
  46. },
  47. "model_snapshot_id" : "1575402237",
  48. "results_index_name" : "shared",
  49. "allow_lazy_open" : false
  50. }
  51. ]
  52. }