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-valid-job]]
|
2020-07-20 16:10:54 -04:00
|
|
|
= Validate {anomaly-jobs} API
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Validate 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
|
|
|
Validates {anomaly-job} configuration information.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-valid-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/_validate`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
[[ml-valid-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
|
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-valid-job-desc]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {api-description-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-12-23 14:38:37 -05:00
|
|
|
This API enables you to validate the {anomaly-job} configuration before you
|
2018-01-15 11:44:08 -05:00
|
|
|
create the job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-valid-job-request-body]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {api-request-body-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
For a list of the properties that you can specify in the body of this API,
|
2019-12-27 16:30:26 -05:00
|
|
|
see <<ml-put-job>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-valid-job-example]]
|
2020-07-20 16:10:54 -04:00
|
|
|
== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
The following example validates job configuration information:
|
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
|
|
|
--------------------------------------------------
|
2018-12-07 15:34:11 -05:00
|
|
|
POST _ml/anomaly_detectors/_validate
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"description": "Unusual response times by airlines",
|
|
|
|
"analysis_config": {
|
|
|
|
"bucket_span": "300S",
|
|
|
|
"detectors": [
|
|
|
|
{
|
|
|
|
"function": "metric",
|
|
|
|
"field_name": "responsetime",
|
|
|
|
"by_field_name": "airline" } ],
|
|
|
|
"influencers": [ "airline" ]
|
|
|
|
},
|
|
|
|
"data_description": {
|
|
|
|
"time_field": "time",
|
|
|
|
"time_format": "yyyy-MM-dd'T'HH:mm:ssX"
|
|
|
|
}
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-08-31 19:49:24 -04:00
|
|
|
// TEST[skip:needs-licence]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
When the validation is complete, you receive the following results:
|
2019-09-06 09:22:08 -04:00
|
|
|
|
|
|
|
[source,console-result]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
2017-04-06 10:56:46 -04:00
|
|
|
"acknowledged": true
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
----
|