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-12-24 03:38:37 +08:00
|
|
|
This API enables you to validate the detector configuration
|
2019-08-07 02:05:01 +08:00
|
|
|
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-25 00:34:03 +08:00
|
|
|
`by_field_name`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=by-field-name]
|
|
|
|
|
|
|
|
`custom_rules`::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
(array)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`actions`:::
|
|
|
|
(array)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-actions]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`scope`:::
|
|
|
|
(object)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-scope]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`scope`.`filter_id`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-id]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`scope`.`filter_type`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-type]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`conditions`:::
|
|
|
|
(array)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`conditions`.`applies_to`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-applies-to]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`conditions`.`operator`::::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-operator]
|
|
|
|
|
|
|
|
`analysis_config`.`detectors`.`custom_rules`.`conditions`.`value`::::
|
|
|
|
(double)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-value]
|
|
|
|
--
|
|
|
|
|
|
|
|
`detector_description`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=detector-description]
|
|
|
|
|
|
|
|
`detector_index`::
|
|
|
|
(integer)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=detector-index]
|
|
|
|
|
|
|
|
`exclude_frequent`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=exclude-frequent]
|
|
|
|
|
|
|
|
`field_name`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=detector-field-name]
|
|
|
|
|
|
|
|
`function`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=function]
|
|
|
|
|
|
|
|
`over_field_name`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=over-field-name]
|
|
|
|
|
|
|
|
`partition_field_name`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=partition-field-name]
|
|
|
|
|
|
|
|
`use_null`::
|
|
|
|
(boolean)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=use-null]
|
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
|
|
|
|
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
|
|
|
}
|
|
|
|
----
|