--- id: use-playbooks-with-monitors title: Automated Playbooks in Monitors description: Learn how to use Automation Service playbooks with monitors. slug: /help/docs/alerts/monitors/use-playbooks-with-monitors/ canonical: https://www.sumologic.com/help/docs/alerts/monitors/use-playbooks-with-monitors/ --- import useBaseUrl from '@docusaurus/useBaseUrl'; import Iframe from 'react-iframe'; This article describes how to configure automated playbooks in monitors. An *automated playbook* is a [playbook in the Automation Service](/docs/platform-services/automation-service/playbooks), and is a predefined set of actions and conditional statements that run in an automated workflow to respond to an event. For example, suppose that a monitor detects suspicious behavior that could indicate a security problem. When the monitor sends the alert, it could also run an automated playbook to respond to the event. To add an automated playbook to a monitor, see [Add an automated playbook to a monitor](#add-an-automated-playbook-to-a-monitor) below. To create a monitor that detects and automatically responds to suspicious behavior (anomalies), see [Create an anomaly monitor that runs an automated playbook](#create-an-anomaly-monitor-that-runs-an-automated-playbook) below. ## Prerequisites Automated playbooks are managed by the [Automation Service](/docs/platform-services/automation-service). To use automated playbooks with monitors, you must perform tasks to enable the Automation Service. See [Prerequisites](/docs/platform-services/automation-service/about-automation-service/#prerequisites) for the Automation Service. ## Access automated playbooks for monitors When working with monitors, use the following ways to access playbooks in the Automation Service. ### When creating a monitor 1. Create a [monitor](/docs/alerts/monitors/create-monitor). 1. Go to the [**Playbook**](/docs/alerts/monitors/create-monitor/#step-4-playbook-optional) section. 1. Click **Manage Playbooks**.
Playbooks are displayed in the Automation Service. For more information, see [Add an automated playbook to a monitor](/docs/alerts/monitors/use-playbooks-with-monitors#add-an-automated-playbook-to-a-monitor) below. ### When viewing an alert 1. Go to your **Alert List** and click on any alert to open its [details page](/docs/alerts/monitors/alert-response/#alert-details). 1. Click the **Playbook** button. The attached playbooks, if assigned during Monitor configuration, are displayed along with their execution status. 1. Click the name of an attached playbook.
The playbook is opened in the Automation Service. For more information, see [View automated playbooks for an alert](#view-automated-playbooks-for-an-alert) below. ### From the main navigation menu 1. [**New UI**](/docs/get-started/sumo-logic-ui). In the main Sumo Logic menu, select **Automation > Playbooks**. You can also click the **Go To...** menu at the top of the screen and select **Playbooks**.
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Automation**. 1. The Automation Service screen opens on the **Playbook** tab. For more information, see [About the Automation Service](/docs/platform-services/automation-service/about-automation-service/). ## Add an automated playbook to a monitor 1. [Open the **New Monitor** window](/docs/alerts/monitors/create-monitor/#open-the-new-monitor-window). 1. Perform [Step 1](/docs/alerts/monitors/create-monitor/#step-1-set-trigger-conditions), [Step 2](/docs/alerts/monitors/create-monitor/#step-2-advanced-settings-optional), and [Step 3](/docs/alerts/monitors/create-monitor/#step-3-notifications-optional) in the **New Monitor** window. 1. In [Step 4: Playbook](/docs/alerts/monitors/create-monitor/#step-4-playbook-optional), click the field under **Automated Playbooks** to select a [playbook in the Automation Service](/docs/platform-services/automation-service/playbooks/) to run when an alert is fired.
Add a playbook to a monitor 1. (Optional) Click **Manage Playbooks** to see playbooks in the Automation Service. From here you can view the playbook you selected above and look at its details in the Automation Service to determine if it is the one you want to run when the alert is triggered. You can also edit the playbook, or if you want, create a new playbook in the Automation Service to use in the monitor. After you add playbooks to the monitor, when the monitor triggers an alert, the selected playbooks run automatically. ## View automated playbooks for an alert Once a monitor triggers an alert with one or more attached playbooks, you can view the playbooks for the alert. 1. Go to your **Alert List** and click on any alert to open its [details page](/docs/alerts/monitors/alert-response/#alert-details). 1. Click the **Playbook** button. The attached playbooks are displayed.
View playbooks for an alert 1. Hover your mouse over the icon to the right of the playbook name to view the status of the playbooks: | Icon | Description | | :-- | :-- | | Playbook running icon | Running | | Waiting for user interaction icon | Waiting for user interaction | | Completed icon | Completed | | Completed icon | Completed with errors | 1. Click the playbook name to open the [playbook in the Automation Service](/docs/platform-services/automation-service/playbooks/).
The playbook shows the status of each action in the playbook that ran for the alert. For example, **Success** displays at the bottom of actions that have successfully completed, **Failed** for actions that did not complete, or **Waiting Owner** for actions that need user interaction.
Playbook in the Automation Service 1. Click an action to view more about its status. Status information opens in a box to the left.
In the following example of an action whose status is **Waiting Owner**, an **Action Task** appears in the box that describes user interaction required to complete the task.
Playbook awaiting user interaction 1. If you have an action marked as **Waiting Owner**, perform the steps needed to complete the **Action Task**. When done, click the appropriate button at the bottom of the **Waiting Owner** action box (**Approve**, **Approve & Close**, or **Reject**). The action completes, and the subsequent remaining actions in the playbook run.
Playbook awaiting user interaction 1. Address any other actions in the playbook that need attention. For example, click and open any failed actions to see why they failed and to determine what you need to do to get them to complete successfully. ## Create an anomaly monitor that runs an automated playbook You can create a monitor that triggers an alert that in turn runs an automated playbook in response to unusual behavior (an anomaly). An anomaly monitor is triggered when unusual conditions are detected. Anomaly monitors leverage a machine learning model to detect anomalies and identify unusual patterns of activity. The output of the machine learning model are baselines for normal behavior, in the form of lower and upper thresholds, so that deviations from baselines signal unusual activity and trigger alerts. :::note Weekly seasonality detection is turned off by default to optimize performance. [Contact Sumo Logic Customer Support](https://support.sumologic.com/support/s/contactsupport) to activate it for specific monitors. (*Weekly seasonality detection* is the optimization of baseline calculations to account for the variations of data flow that can occur in a work week.) ::: :::training Micro Lesson Watch this micro lesson to learn about anomaly monitors.