Create an alert using an SPL2 search
Save an SPL2 search as an alert that initializes actions such as email notifications when the search results meet the specified conditions.
An alert is a saved search that initializes one or more alert actions when the search returns results that meet specific conditions. For example, you can create an alert that sends an email notification to the Splunk platform administrator if the search results show that the volume of data being ingested from a data source is above an accepted threshold.
You can use alerts to monitor for and respond to specific events. Alerts are available on the Alerts page in the Search & Reporting app.
For complete information about alerts, see the following documentation:
Splunk Cloud Platform
See the Alerting Manual in the Splunk Cloud Platform documentation.
Splunk Enterprise
See the in Alerting Manual the Splunk Enterprise documentation.
The exact workflow for creating an alert from an SPL2 search varies depending on whether you are working with searches in the Search bar or the SPL2 module editor. For detailed instructions, see the following sections on this page:
Save a search as an alert from the Search bar
After running a search, you can save the saerch as an alert from the Search bar.
On the Search page of the Search & Reporting app, after running a search, you can use the Save As menu located above the Search bar to save your search as an alert.
The Search & Reporting app returns a message confirming that your alert has been successfully created, and displays options for next steps that you can take with your alert, such as editing the alert or changing the permissions associated with it.
To see a list of all your alerts, navigate to the Alerts page of the Search & Reporting app.
Save a search as an alert from the SPL2 module editor
After you run a search, you can save the search as an alert from the SPL2 module editor.
The following instructions assume that you have already created an SPL2 module containing the search that you want to save as an alert. For detailed information on how to navigate to the SPL2 module editor and create a module, see SPL2 module editor overview and Create an SPL2 module.
In the SPL2 module editor, after writing a search, you can use the options in the Outline panel to export the search and then save it as an alert.
- Open your SPL2 module for editing in the SPL2 module editor.
- In the Outline panel, select the Options icon (
) beside the name of the search that you want to save as a report, and then select Export.
- Select Save to save your changes to the module.
- In the Outline panel, select the Options icon (
) beside the name of the search, and then select Use in alert.
- In the Alert title field, enter a unique name for the alert.
- (Optional) In the Description field, enter a description for the alert.
- On the Schedule & trigger conditions tab, do the following:
- On the Trigger actions tab, select and configure one or more actions that occur when the alert triggers.
- Select Save.
The SPL2 module editor returns a message confirming that your alert has been successfully created, and displays options for next steps that you can take with your alert, such as editing the alert or changing the permissions associated with it.
To see a list of all your alerts, navigate to the Alerts page of the Search & Reporting app.
See also
For more information about working with alerts:
Splunk Cloud Platform
See the Alerting Manual in the Splunk Cloud Platform documentation.
Splunk Enterprise
See the Alerting Manual in the Splunk Enterprise documentation.