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-update-job]]
|
2019-08-06 14:05:01 -04:00
|
|
|
=== Update {anomaly-jobs} API
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Update jobs</titleabbrev>
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-08-06 14:05:01 -04:00
|
|
|
Updates certain properties of an {anomaly-job}.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-job-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`POST _ml/anomaly_detectors/<job_id>/_update`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
[[ml-update-job-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have `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-update-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
|
|
|
(Required, string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-job-request-body]]
|
|
|
|
==== {api-request-body-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
The following properties can be updated after the job is created:
|
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`allow_lazy_open`::
|
|
|
|
(boolean)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=allow-lazy-open]
|
|
|
|
+
|
|
|
|
--
|
|
|
|
NOTE: If the job is open when you make the update, you must stop the {dfeed},
|
|
|
|
close the job, then reopen the job and restart the {dfeed} for the changes to take effect.
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
[[update-analysislimits]]`analysis_limits`.`model_memory_limit`::
|
|
|
|
(long or string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=model-memory-limit]
|
|
|
|
+
|
|
|
|
--
|
|
|
|
NOTE: You can update the `analysis_limits` only while the job is closed. The
|
|
|
|
`model_memory_limit` property value cannot be decreased below the current usage.
|
|
|
|
|
|
|
|
TIP: If the `memory_status` property in the
|
|
|
|
<<ml-get-snapshot-results,`model_size_stats` object>> has a value of `hard_limit`,
|
|
|
|
this means that it was unable to process some data. You might want to re-run the
|
|
|
|
job with an increased `model_memory_limit`.
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
`background_persist_interval`::
|
|
|
|
(<<time-units,time units>>)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=background-persist-interval]
|
|
|
|
+
|
|
|
|
--
|
|
|
|
NOTE: If the job is open when you make the update, you must stop the {dfeed},
|
|
|
|
close the job, then reopen the job and restart the {dfeed} for the changes to take effect.
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
[[update-customsettings]]`custom_settings`::
|
|
|
|
(object)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-settings]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`description`::
|
|
|
|
(string) A description of the job.
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`::
|
|
|
|
(array) An array of detector update objects.
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`:::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
(array)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules]
|
|
|
|
|
|
|
|
`detectors`.`custom_rules`.`actions`:::
|
|
|
|
(array)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-actions]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`.`scope`:::
|
|
|
|
(object)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-scope]
|
2017-08-17 15:52:29 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`.`scope`.`filter_id`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-id]
|
2019-10-02 04:04:35 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`.`scope`.`filter_type`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-type]
|
2019-10-02 04:04:35 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`.`conditions`:::
|
|
|
|
(array)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions]
|
2019-10-02 04:04:35 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`.`conditions`.`applies_to`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-applies-to]
|
2018-07-25 11:10:32 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`.`conditions`.`operator`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-operator]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`custom_rules`.`conditions`.`value`::::
|
|
|
|
(double)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-value]
|
|
|
|
--
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`description`:::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=detector-description]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`.`detector_index`:::
|
2020-01-09 11:34:34 -05:00
|
|
|
+
|
|
|
|
--
|
2019-12-27 16:30:26 -05:00
|
|
|
(integer)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=detector-index]
|
2020-01-09 11:34:34 -05:00
|
|
|
If you want to update a specific detector, you must use this identifier. You
|
|
|
|
cannot, however, change the `detector_index` value for a detector.
|
|
|
|
--
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`groups`::
|
|
|
|
(array of strings)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=groups]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`model_plot_config`::
|
|
|
|
(object)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=model-plot-config]
|
2019-10-15 01:55:11 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`model_plot_config`.`enabled`:::
|
|
|
|
(boolean)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=model-plot-config-enabled]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`model_snapshot_retention_days`::
|
|
|
|
(long)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=model-snapshot-retention-days]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`renormalization_window_days`::
|
|
|
|
(long)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=renormalization-window-days]
|
|
|
|
+
|
2017-04-24 13:46:17 -04:00
|
|
|
--
|
2019-12-27 16:30:26 -05:00
|
|
|
NOTE: If the job is open when you make the update, you must stop the {dfeed},
|
|
|
|
close the job, then reopen the job and restart the {dfeed} for the changes to take effect.
|
|
|
|
|
2017-04-24 13:46:17 -04:00
|
|
|
--
|
2019-12-27 16:30:26 -05:00
|
|
|
`results_retention_days`::
|
|
|
|
(long)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=results-retention-days]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-job-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2017-04-04 18:26:39 -04:00
|
|
|
--------------------------------------------------
|
2020-01-09 11:34:34 -05:00
|
|
|
POST _ml/anomaly_detectors/low_request_rate/_update
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2017-05-02 18:34:30 -04:00
|
|
|
"description":"An updated job",
|
2020-01-09 11:34:34 -05:00
|
|
|
"detectors": {
|
|
|
|
"detector_index": 0,
|
|
|
|
"description": "An updated detector description"
|
|
|
|
},
|
|
|
|
"groups": ["kibana_sample_data","kibana_sample_web_logs"],
|
2017-05-02 18:34:30 -04:00
|
|
|
"model_plot_config": {
|
|
|
|
"enabled": true
|
|
|
|
},
|
|
|
|
"renormalization_window_days": 30,
|
|
|
|
"background_persist_interval": "2h",
|
|
|
|
"model_snapshot_retention_days": 7,
|
2020-01-09 11:34:34 -05:00
|
|
|
"results_retention_days": 60
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2020-01-09 11:34:34 -05:00
|
|
|
// TEST[skip:setup:Kibana sample data]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-08-06 14:05:01 -04:00
|
|
|
When the {anomaly-job} is updated, you receive a summary of the job
|
|
|
|
configuration information, including the updated property values. For example:
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-01-09 11:34:34 -05:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
2020-01-09 11:34:34 -05:00
|
|
|
"job_id" : "low_request_rate",
|
|
|
|
"job_type" : "anomaly_detector",
|
|
|
|
"job_version" : "7.5.1",
|
|
|
|
"groups" : [
|
|
|
|
"kibana_sample_data",
|
|
|
|
"kibana_sample_web_logs"
|
2017-08-17 15:52:29 -04:00
|
|
|
],
|
2020-01-09 11:34:34 -05:00
|
|
|
"description" : "An updated job",
|
|
|
|
"create_time" : 1578101716125,
|
|
|
|
"finished_time" : 1578101721816,
|
|
|
|
"analysis_config" : {
|
|
|
|
"bucket_span" : "1h",
|
|
|
|
"summary_count_field_name" : "doc_count",
|
|
|
|
"detectors" : [
|
2017-05-02 18:34:30 -04:00
|
|
|
{
|
2020-01-09 11:34:34 -05:00
|
|
|
"detector_description" : "An updated detector description",
|
|
|
|
"function" : "low_count",
|
|
|
|
"detector_index" : 0
|
2017-05-02 18:34:30 -04:00
|
|
|
}
|
|
|
|
],
|
2020-01-09 11:34:34 -05:00
|
|
|
"influencers" : [ ]
|
2017-04-11 21:52:47 -04:00
|
|
|
},
|
2020-01-09 11:34:34 -05:00
|
|
|
...
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
----
|