2017-06-20 09:23:58 +08:00
|
|
|
[role="xpack"]
|
2018-09-01 07:49:24 +08:00
|
|
|
[testenv="platinum"]
|
2017-04-05 06:26:39 +08:00
|
|
|
[[ml-valid-detector]]
|
2018-12-21 02:23:28 +08:00
|
|
|
=== Validate detectors API
|
2017-12-15 02:52:49 +08:00
|
|
|
++++
|
2019-08-07 02:05:01 +08:00
|
|
|
<titleabbrev>Validate detectors</titleabbrev>
|
2017-12-15 02:52:49 +08:00
|
|
|
++++
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2018-06-14 04:37:35 +08:00
|
|
|
Validates detector configuration information.
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-detector-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2018-12-08 04:34:11 +08:00
|
|
|
`POST _ml/anomaly_detectors/_validate/detector`
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 04:58:42 +08:00
|
|
|
[[ml-valid-detector-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-05 07:10:26 +08:00
|
|
|
<<security-privileges>>.
|
2019-06-28 04:58:42 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-detector-desc]]
|
|
|
|
==== {api-description-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-08-07 02:05:01 +08:00
|
|
|
This API enables you validate the detector configuration
|
|
|
|
before you create an {anomaly-job}.
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-detector-request-body]]
|
|
|
|
==== {api-request-body-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-12-07 07:32:07 +08:00
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=detector]
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-detector-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2017-04-06 22:56:46 +08:00
|
|
|
The following example validates detector configuration information:
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-09-09 22:45:37 +08:00
|
|
|
[source,console]
|
2017-04-05 06:26:39 +08:00
|
|
|
--------------------------------------------------
|
2018-12-08 04:34:11 +08:00
|
|
|
POST _ml/anomaly_detectors/_validate/detector
|
2017-04-05 06:26:39 +08:00
|
|
|
{
|
2017-04-12 09:52:47 +08:00
|
|
|
"function": "metric",
|
|
|
|
"field_name": "responsetime",
|
|
|
|
"by_field_name": "airline"
|
2017-04-05 06:26:39 +08:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-09-01 07:49:24 +08:00
|
|
|
// TEST[skip:needs-licence]
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2017-04-06 22:56:46 +08:00
|
|
|
When the validation completes, you receive the following results:
|
2019-09-06 04:47:18 +08:00
|
|
|
|
|
|
|
[source,console-result]
|
2017-04-05 06:26:39 +08:00
|
|
|
----
|
|
|
|
{
|
2017-04-06 22:56:46 +08:00
|
|
|
"acknowledged": true
|
2017-04-05 06:26:39 +08:00
|
|
|
}
|
|
|
|
----
|