ml-configuring-alerts.asciidoc 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. [role="xpack"]
  2. [[ml-configuring-alerts]]
  3. = Configuring {anomaly-detect} alerts
  4. beta::[]
  5. {anomaly-detect-cap} alerts run scheduled checks on an {anomaly-job} or a group
  6. of jobs to detect anomalies with certain conditions. If an anomaly meets the
  7. conditions, the alert triggers the defined action. For example, you can create
  8. an alert that checks an {anomaly-job} every fifteen minutes for critical
  9. anomalies and notifies you in an email. This page helps you to configure an
  10. {anomaly-detect} alert. To learn more about alerts in the {stack}, refer to
  11. {kibana-ref}/alerting-getting-started.html#alerting-getting-started[Alerting and Actions].
  12. [[creating-anomaly-alerts]]
  13. == Creating an alert
  14. You can create {anomaly-detect} alerts in the {anomaly-job} wizard after you
  15. start the job, from the job list, or under **{stack-manage-app} > {alerts-ui}**.
  16. On the *Create alert* window, select *{anomaly-detect-cap} alert* under the
  17. {ml-cap} section, then give a name to the alert and optionally provide tags.
  18. Specify the time interval for the alert to check detected anomalies. It is
  19. recommended to select an interval that is close to the bucket span of the
  20. associated job. You can also select a notification option by using the _Notify_
  21. selector. An alert instance remains active as long as anomalies are found for a
  22. particular {anomaly-job} during the check interval. When there is no anomaly
  23. found in the next interval, the `Recovered` action group is invoked and the
  24. status of the alert instance changes to `OK`. For more details, refer to the
  25. documentation of
  26. {kibana-ref}/defining-alerts.html#defining-alerts-general-details[general alert details].
  27. [role="screenshot"]
  28. image::images/ml-anomaly-alert-type.jpg["Creating an anomaly detection alert"]
  29. Select the {anomaly-job} or the group of {anomaly-jobs} that is checked by the
  30. alert. If you assign additional jobs to the group, the alert automatically
  31. checks the new jobs the next time when the alert runs.
  32. You can select the result type of the {anomaly-job} that triggers the alert.
  33. In particular, you can create alerts based on bucket, record, or influencer
  34. results.
  35. [role="screenshot"]
  36. image::images/ml-anomaly-alert-severity.jpg["Selecting result type, severity, and test interval"]
  37. For each alert, you can configure the `anomaly_score` that triggers it. The
  38. `anomaly_score` indicates the significance of a given anomaly compared to
  39. previous anomalies. The default severity threshold is 75 which means every
  40. anomaly with an `anomaly_score` of 75 or higher triggers the alert.
  41. You can select whether you want the alert to include interim results. Interim
  42. results are created by the {anomaly-job} before a bucket is finalized. These
  43. results might disappear after the bucket is fully processed. Include
  44. interim results if you want to be notified earlier about a potential anomaly
  45. even if it might be a false positive. If you want to get notified
  46. only about anomalies of fully processed buckets, do not include interim results.
  47. You can also test the configured conditions against your existing data and check
  48. the sample results by providing a valid interval for your data. The generated
  49. preview contains the number of potentially created alert instances during the
  50. relative time range you defined.
  51. [[defining-actions]]
  52. == Defining actions
  53. As a next step, connect your alert to actions that use supported built-in
  54. integrations. Actions are {kib} services or third-party integrations that run
  55. when the alert conditions are met.
  56. [role="screenshot"]
  57. image::images/ml-anomaly-alert-actions.jpg["Selecting action type"]
  58. For example, you can choose _Slack_ as an action type and configure it to send a
  59. message to a channel you selected. You can also create an index connector that
  60. writes the JSON object you configure to a specific index. It's also possible to
  61. customize the notification messages. A list of variables is available to include
  62. in the message, like job ID, anomaly score, time, or top influencers.
  63. [role="screenshot"]
  64. image::images/ml-anomaly-alert-messages.jpg["Customizing your message"]
  65. After you save the configurations, the alert appears in the *{alerts-ui}* list
  66. where you can check its status and see the overview of its configuration
  67. information.
  68. The name of an alert instance is always the same as the job ID of the associated
  69. {anomaly-job} that triggered the alert. You can mute the notifications for a
  70. particular {anomaly-job} on the page of the alert that lists the individual
  71. alert instances. You can open it via *{alerts-ui}* by selecting the alert name.