1
0

validate-detector.asciidoc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-valid-detector]]
  4. = Validate detectors API
  5. ++++
  6. <titleabbrev>Validate detectors</titleabbrev>
  7. ++++
  8. Validates detector configuration information.
  9. [[ml-valid-detector-request]]
  10. == {api-request-title}
  11. `POST _ml/anomaly_detectors/_validate/detector`
  12. [[ml-valid-detector-prereqs]]
  13. == {api-prereq-title}
  14. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  15. `manage` cluster privileges to use this API. See
  16. <<security-privileges>> and {ml-docs-setup-privileges}.
  17. [[ml-valid-detector-desc]]
  18. == {api-description-title}
  19. This API enables you to validate the detector configuration
  20. before you create an {anomaly-job}.
  21. [[ml-valid-detector-request-body]]
  22. == {api-request-body-title}
  23. `by_field_name`::
  24. (string)
  25. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=by-field-name]
  26. `custom_rules`::
  27. +
  28. --
  29. (array)
  30. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules]
  31. `analysis_config`.`detectors`.`custom_rules`.`actions`:::
  32. (array)
  33. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-actions]
  34. `analysis_config`.`detectors`.`custom_rules`.`scope`:::
  35. (object)
  36. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope]
  37. `analysis_config`.`detectors`.`custom_rules`.`scope`.`filter_id`::::
  38. (string)
  39. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-id]
  40. `analysis_config`.`detectors`.`custom_rules`.`scope`.`filter_type`::::
  41. (string)
  42. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-type]
  43. `analysis_config`.`detectors`.`custom_rules`.`conditions`:::
  44. (array)
  45. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions]
  46. `analysis_config`.`detectors`.`custom_rules`.`conditions`.`applies_to`::::
  47. (string)
  48. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-applies-to]
  49. `analysis_config`.`detectors`.`custom_rules`.`conditions`.`operator`::::
  50. (string)
  51. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-operator]
  52. `analysis_config`.`detectors`.`custom_rules`.`conditions`.`value`::::
  53. (double)
  54. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-value]
  55. --
  56. `detector_description`::
  57. (string)
  58. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-description]
  59. `detector_index`::
  60. (integer)
  61. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-index]
  62. `exclude_frequent`::
  63. (string)
  64. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-frequent]
  65. `field_name`::
  66. (string)
  67. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-field-name]
  68. `function`::
  69. (string)
  70. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=function]
  71. `over_field_name`::
  72. (string)
  73. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=over-field-name]
  74. `partition_field_name`::
  75. (string)
  76. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=partition-field-name]
  77. `use_null`::
  78. (boolean)
  79. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=use-null]
  80. [[ml-valid-detector-example]]
  81. == {api-examples-title}
  82. [source,console]
  83. --------------------------------------------------
  84. POST _ml/anomaly_detectors/_validate/detector
  85. {
  86. "function": "metric",
  87. "field_name": "responsetime",
  88. "by_field_name": "airline"
  89. }
  90. --------------------------------------------------
  91. // TEST[skip:needs-licence]
  92. When the validation completes, you receive the following results:
  93. [source,console-result]
  94. ----
  95. {
  96. "acknowledged": true
  97. }
  98. ----