Advanced configuration option. Specifies whether this job can open when
there is insufficient machine learning node capacity for it to be
immediately assigned to a node. If false and a machine learning node
with capacity to run the job cannot immediately be found, the open
anomaly detection jobs API returns an error. However, this is also
subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting. If this
option is set to true, the open anomaly detection jobs API does not
return an error and the job waits in the opening state until sufficient
machine learning node capacity is available.
Default value is false.
Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the value too low. If the job is open when you make the update, you must stop the datafeed, close the job, then reopen the job and restart the datafeed for the changes to take effect.
Advanced configuration option. Contains custom meta data about the job. For example, it can contain custom URL information as shown in Adding custom URLs to machine learning results.
A description of the job.
A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and
d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
Advanced configuration option, which affects the automatic removal of old
model snapshots for this job. It specifies a period of time (in days)
after which only the first snapshot per day is retained. This period is
relative to the timestamp of the most recent snapshot for this job. Valid
values range from 0 to model_snapshot_retention_days. For jobs created
before version 7.8.0, the default value matches
model_snapshot_retention_days.
Default value is 1.
Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job.
Default value is 10.
Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen.
Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained.
A list of job groups. A job can belong to no groups or many.
An array of detector update objects.
Settings related to how categorization interacts with partition fields.
POST _ml/anomaly_detectors/low_request_rate/_update
{
"description":"An updated job",
"detectors": {
"detector_index": 0,
"description": "An updated detector description"
},
"groups": ["kibana_sample_data","kibana_sample_web_logs"],
"model_plot_config": {
"enabled": true
},
"renormalization_window_days": 30,
"background_persist_interval": "2h",
"model_snapshot_retention_days": 7,
"results_retention_days": 60
}
resp = client.ml.update_job(
job_id="low_request_rate",
description="An updated job",
detectors={
"detector_index": 0,
"description": "An updated detector description"
},
groups=[
"kibana_sample_data",
"kibana_sample_web_logs"
],
model_plot_config={
"enabled": True
},
renormalization_window_days=30,
background_persist_interval="2h",
model_snapshot_retention_days=7,
results_retention_days=60,
)
const response = await client.ml.updateJob({
job_id: "low_request_rate",
description: "An updated job",
detectors: {
detector_index: 0,
description: "An updated detector description",
},
groups: ["kibana_sample_data", "kibana_sample_web_logs"],
model_plot_config: {
enabled: true,
},
renormalization_window_days: 30,
background_persist_interval: "2h",
model_snapshot_retention_days: 7,
results_retention_days: 60,
});
response = client.ml.update_job(
job_id: "low_request_rate",
body: {
"description": "An updated job",
"detectors": {
"detector_index": 0,
"description": "An updated detector description"
},
"groups": [
"kibana_sample_data",
"kibana_sample_web_logs"
],
"model_plot_config": {
"enabled": true
},
"renormalization_window_days": 30,
"background_persist_interval": "2h",
"model_snapshot_retention_days": 7,
"results_retention_days": 60
}
)
$resp = $client->ml()->updateJob([
"job_id" => "low_request_rate",
"body" => [
"description" => "An updated job",
"detectors" => [
"detector_index" => 0,
"description" => "An updated detector description",
],
"groups" => array(
"kibana_sample_data",
"kibana_sample_web_logs",
),
"model_plot_config" => [
"enabled" => true,
],
"renormalization_window_days" => 30,
"background_persist_interval" => "2h",
"model_snapshot_retention_days" => 7,
"results_retention_days" => 60,
],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"description":"An updated job","detectors":{"detector_index":0,"description":"An updated detector description"},"groups":["kibana_sample_data","kibana_sample_web_logs"],"model_plot_config":{"enabled":true},"renormalization_window_days":30,"background_persist_interval":"2h","model_snapshot_retention_days":7,"results_retention_days":60}' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_update"
client.ml().updateJob(u -> u
.backgroundPersistInterval(b -> b
.time("2h")
)
.description("An updated job")
.detectors(d -> d
.detectorIndex(0)
.description("An updated detector description")
)
.groups(List.of("kibana_sample_data","kibana_sample_web_logs"))
.jobId("low_request_rate")
.modelPlotConfig(m -> m
.enabled(true)
)
.modelSnapshotRetentionDays(7L)
.renormalizationWindowDays(30L)
.resultsRetentionDays(60L)
);
{
"description":"An updated job",
"detectors": {
"detector_index": 0,
"description": "An updated detector description"
},
"groups": ["kibana_sample_data","kibana_sample_web_logs"],
"model_plot_config": {
"enabled": true
},
"renormalization_window_days": 30,
"background_persist_interval": "2h",
"model_snapshot_retention_days": 7,
"results_retention_days": 60
}