2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-get-job]]
|
2019-07-30 13:52:23 -04:00
|
|
|
=== Get {anomaly-jobs} API
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Get jobs</titleabbrev>
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-30 13:52:23 -04:00
|
|
|
Retrieves configuration information for {anomaly-jobs}.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-job-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/anomaly_detectors/<job_id>` +
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/anomaly_detectors/<job_id>,<job_id>` +
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/anomaly_detectors/` +
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/anomaly_detectors/_all`
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
[[ml-get-job-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have `monitor_ml`,
|
|
|
|
`monitor`, `manage_ml`, or `manage` cluster privileges to use this API. See
|
2019-10-07 18:23:19 -04:00
|
|
|
<<security-privileges>>.
|
2019-06-27 16:58:42 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-job-desc]]
|
|
|
|
==== {api-description-title}
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2019-07-30 13:52:23 -04:00
|
|
|
You can get information for multiple {anomaly-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-jobs} by using `_all`, by specifying
|
|
|
|
`*` as the `<job_id>`, or by omitting the `<job_id>`.
|
2017-04-11 21:52:47 -04:00
|
|
|
|
2019-01-17 11:21:37 -05:00
|
|
|
IMPORTANT: This API returns a maximum of 10,000 jobs.
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-job-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<job_id>`::
|
2019-12-27 16:30:26 -05:00
|
|
|
(Optional, string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection-default]
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2019-07-30 08:22:14 -04:00
|
|
|
[[ml-get-job-query-parms]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
`allow_no_jobs`::
|
2019-12-27 16:30:26 -05:00
|
|
|
(Optional, boolean)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-jobs]
|
2019-07-30 08:22:14 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-job-results]]
|
|
|
|
==== {api-response-body-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
The API returns an array of {anomaly-job} resources. For the full list of
|
|
|
|
properties, see <<ml-put-job-request-body,create {anomaly-jobs} API>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`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 {es} that existed on the node when the job was created.
|
|
|
|
|
|
|
|
`model_snapshot_id`::
|
|
|
|
(string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=snapshot-id]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-30 08:22:14 -04:00
|
|
|
[[ml-get-job-response-codes]]
|
|
|
|
==== {api-response-codes-title}
|
|
|
|
|
|
|
|
`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.
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-job-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2017-04-11 21:52:47 -04:00
|
|
|
--------------------------------------------------
|
2019-12-27 16:30:26 -05:00
|
|
|
GET _ml/anomaly_detectors/high_sum_total_sales
|
2017-04-11 21:52:47 -04:00
|
|
|
--------------------------------------------------
|
2019-12-27 16:30:26 -05:00
|
|
|
// TEST[skip:Kibana sample data]
|
2017-04-11 21:52:47 -04:00
|
|
|
|
2017-05-08 09:53:04 -04:00
|
|
|
The API returns the following results:
|
2019-09-06 16:09:09 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
|
|
|
"count": 1,
|
|
|
|
"jobs": [
|
2017-04-11 21:52:47 -04:00
|
|
|
{
|
2019-12-27 16:30:26 -05:00
|
|
|
"job_id" : "high_sum_total_sales",
|
|
|
|
"job_type" : "anomaly_detector",
|
|
|
|
"job_version" : "7.5.0",
|
|
|
|
"groups" : [
|
|
|
|
"kibana_sample_data",
|
|
|
|
"kibana_sample_ecommerce"
|
|
|
|
],
|
|
|
|
"description" : "Find customers spending an unusually high amount in an hour",
|
|
|
|
"create_time" : 1577221534700,
|
|
|
|
"analysis_config" : {
|
|
|
|
"bucket_span" : "1h",
|
|
|
|
"detectors" : [
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2019-12-27 16:30:26 -05:00
|
|
|
"detector_description" : "High total sales",
|
|
|
|
"function" : "high_sum",
|
|
|
|
"field_name" : "taxful_total_price",
|
|
|
|
"over_field_name" : "customer_full_name.keyword",
|
|
|
|
"detector_index" : 0
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
],
|
2019-12-27 16:30:26 -05:00
|
|
|
"influencers" : [
|
|
|
|
"customer_full_name.keyword",
|
|
|
|
"category.keyword"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"analysis_limits" : {
|
|
|
|
"model_memory_limit" : "10mb",
|
|
|
|
"categorization_examples_limit" : 4
|
|
|
|
},
|
|
|
|
"data_description" : {
|
|
|
|
"time_field" : "order_date",
|
|
|
|
"time_format" : "epoch_ms"
|
2018-02-09 12:16:24 -05:00
|
|
|
},
|
2019-12-27 16:30:26 -05:00
|
|
|
"model_plot_config" : {
|
|
|
|
"enabled" : true
|
2017-04-04 18:26:39 -04:00
|
|
|
},
|
2020-05-05 09:31:58 -04:00
|
|
|
"model_snapshot_retention_days" : 10,
|
|
|
|
"daily_model_snapshot_retention_after_days" : 1,
|
2019-12-27 16:30:26 -05:00
|
|
|
"custom_settings" : {
|
|
|
|
"created_by" : "ml-module-sample",
|
|
|
|
...
|
2017-04-04 18:26:39 -04:00
|
|
|
},
|
2019-12-27 16:30:26 -05:00
|
|
|
"model_snapshot_id" : "1575402237",
|
|
|
|
"results_index_name" : "shared",
|
|
|
|
"allow_lazy_open" : false
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|