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]]
|
2020-07-20 16:10:54 -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]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {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]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {api-prereq-title}
|
2019-06-27 16:58:42 -04:00
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have `manage_ml` or
|
|
|
|
`manage` cluster privileges to use this API. See
|
2020-07-23 19:43:10 -04:00
|
|
|
<<security-privileges>> and {ml-docs-setup-privileges}.
|
2019-06-27 16:58:42 -04:00
|
|
|
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-job-path-parms]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {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)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
[role="child_attributes"]
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-job-request-body]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {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)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-lazy-open]
|
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.
|
|
|
|
|
|
|
|
--
|
2020-03-30 14:06:33 -04:00
|
|
|
//Begin analysis_limits
|
|
|
|
[[update-analysislimits]]`analysis_limits`::
|
|
|
|
(Optional, object)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=analysis-limits]
|
2020-03-30 14:06:33 -04:00
|
|
|
+
|
|
|
|
.Properties of `analysis_limits`
|
|
|
|
[%collapsible%open]
|
|
|
|
====
|
|
|
|
`model_memory_limit`:::
|
2019-12-27 16:30:26 -05:00
|
|
|
(long or string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-memory-limit]
|
2019-12-27 16:30:26 -05:00
|
|
|
+
|
|
|
|
--
|
|
|
|
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
|
2020-03-30 14:06:33 -04:00
|
|
|
<<ml-get-snapshot-results,`model_size_stats` object>> has a value of
|
2020-08-25 20:12:43 -04:00
|
|
|
`hard_limit`, this means that it was unable to process some data. You might want
|
2020-03-30 14:06:33 -04:00
|
|
|
to re-run the job with an increased `model_memory_limit`.
|
2019-12-27 16:30:26 -05:00
|
|
|
|
|
|
|
--
|
2020-03-30 14:06:33 -04:00
|
|
|
====
|
|
|
|
//End analysis_limits
|
2019-12-27 16:30:26 -05:00
|
|
|
|
|
|
|
`background_persist_interval`::
|
|
|
|
(<<time-units,time units>>)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=background-persist-interval]
|
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.
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
[[update-customsettings]]`custom_settings`::
|
|
|
|
(object)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-settings]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-05-05 09:31:58 -04:00
|
|
|
`daily_model_snapshot_retention_after_days`::
|
|
|
|
(long)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=daily-model-snapshot-retention-after-days]
|
2020-05-05 09:31:58 -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
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
//Begin detectors
|
2019-12-27 16:30:26 -05:00
|
|
|
`detectors`::
|
|
|
|
(array) An array of detector update objects.
|
|
|
|
+
|
2020-03-30 14:06:33 -04:00
|
|
|
.Properties of `detectors`
|
|
|
|
[%collapsible%open]
|
|
|
|
====
|
|
|
|
|
|
|
|
//Begin detectors.custom_rules
|
|
|
|
`custom_rules`:::
|
2019-12-27 16:30:26 -05:00
|
|
|
(array)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules]
|
2020-03-30 14:06:33 -04:00
|
|
|
+
|
|
|
|
.Properties of `custom_rules`
|
|
|
|
[%collapsible%open]
|
|
|
|
=====
|
2019-12-27 16:30:26 -05:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
`actions`:::
|
2019-12-27 16:30:26 -05:00
|
|
|
(array)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-actions]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
// Begin detectors.custom_rules.conditions
|
|
|
|
`conditions`:::
|
2019-12-27 16:30:26 -05:00
|
|
|
(array)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions]
|
2020-03-30 14:06:33 -04:00
|
|
|
+
|
|
|
|
.Properties of `conditions`
|
|
|
|
[%collapsible%open]
|
|
|
|
======
|
2019-10-02 04:04:35 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
`applies_to`::::
|
2019-12-27 16:30:26 -05:00
|
|
|
(string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-applies-to]
|
2018-07-25 11:10:32 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
`operator`::::
|
2019-12-27 16:30:26 -05:00
|
|
|
(string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-operator]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
`value`::::
|
2019-12-27 16:30:26 -05:00
|
|
|
(double)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-value]
|
2020-03-30 14:06:33 -04:00
|
|
|
======
|
|
|
|
//End detectors.custom_rules.conditions
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
//Begin detectors.custom_rules.scope
|
|
|
|
`scope`:::
|
|
|
|
(object)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope]
|
2020-03-30 14:06:33 -04:00
|
|
|
+
|
|
|
|
.Properties of `scope`
|
|
|
|
[%collapsible%open]
|
|
|
|
======
|
|
|
|
`filter_id`::::
|
|
|
|
(string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-id]
|
2020-03-30 14:06:33 -04:00
|
|
|
|
|
|
|
`filter_type`::::
|
|
|
|
(string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-type]
|
2020-03-30 14:06:33 -04:00
|
|
|
======
|
|
|
|
//End detectors.custom_rules.scope
|
|
|
|
=====
|
|
|
|
//End detectors.custom_rules
|
|
|
|
|
|
|
|
`description`:::
|
2019-12-27 16:30:26 -05:00
|
|
|
(string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-description]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
`detector_index`:::
|
2019-12-27 16:30:26 -05:00
|
|
|
(integer)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-index]
|
2020-03-30 14:06:33 -04:00
|
|
|
+
|
|
|
|
--
|
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.
|
|
|
|
--
|
2020-03-30 14:06:33 -04:00
|
|
|
====
|
|
|
|
//End detectors
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`groups`::
|
|
|
|
(array of strings)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=groups]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
//Begin model_plot_config
|
2019-12-27 16:30:26 -05:00
|
|
|
`model_plot_config`::
|
|
|
|
(object)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-plot-config]
|
2020-03-30 14:06:33 -04:00
|
|
|
+
|
|
|
|
.Properties of `model_plot_config`
|
|
|
|
[%collapsible%open]
|
|
|
|
====
|
2020-06-04 09:15:35 -04:00
|
|
|
`annotations_enabled`:::
|
|
|
|
(boolean)
|
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-plot-config-annotations-enabled]
|
|
|
|
|
2020-03-30 14:06:33 -04:00
|
|
|
`enabled`:::
|
2019-12-27 16:30:26 -05:00
|
|
|
(boolean)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-plot-config-enabled]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2020-06-04 09:15:35 -04:00
|
|
|
`terms`:::
|
|
|
|
experimental[] (string)
|
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-plot-config-terms]
|
2020-03-30 14:06:33 -04:00
|
|
|
====
|
|
|
|
//End model_plot_config
|
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`model_snapshot_retention_days`::
|
|
|
|
(long)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-snapshot-retention-days]
|
2017-05-02 18:34:30 -04:00
|
|
|
|
2020-06-06 03:15:17 -04:00
|
|
|
//Begin per_partition_categorization
|
|
|
|
`per_partition_categorization`:::
|
|
|
|
(object)
|
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=per-partition-categorization]
|
|
|
|
+
|
|
|
|
.Properties of `per_partition_categorization`
|
|
|
|
[%collapsible%open]
|
|
|
|
====
|
|
|
|
`enabled`:::
|
|
|
|
(boolean)
|
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=per-partition-categorization-enabled]
|
|
|
|
|
|
|
|
`stop_on_warn`:::
|
|
|
|
(boolean)
|
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=per-partition-categorization-stop-on-warn]
|
|
|
|
====
|
|
|
|
//End per_partition_categorization
|
|
|
|
|
2019-12-27 16:30:26 -05:00
|
|
|
`renormalization_window_days`::
|
|
|
|
(long)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=renormalization-window-days]
|
2019-12-27 16:30:26 -05:00
|
|
|
+
|
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)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/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]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {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
|
|
|
}
|
|
|
|
----
|