Skip to main content
Sumo Logic

Create an Email Alert

Create a scheduled search email alert

  1. First, create a scheduled search. See Schedule a Search. Then, follow the below steps to create an email alert.
  2. Alert condition. Select Send Notification:
    • Every time a search is complete. Select this option if you want an email with search results every time the search is run (depending on the frequency, you could get an email every 15 minutes, every hour, or once a day).
    • If the following condition is met. Select this option if you'd like to set up a scheduled search that alerts you to specific events.
    • Number of results. Depending on the search, set a condition to receive an email by the number of results. If your saved search returns log messages, then the alert will use the number of messages you specify. If your query produces aggregate results, the alert will use the number of rows or aggregates (or groups) and will not trigger based on the number of raw results. For more control of your query, you can build in a threshold (for example | where _count > 30)  into the Search itself and set the alerts condition here to Greater than 0. That way the query will generate results if the expected condition is met.
      • Equal to. Choose if there is an exact number of records in a search result at which you want to be notified.
      • Greater than. Choose if you want to be notified only if the search results include greater than that number of messages or groups you set in the text box.
      • Greater than or equal to. Choose if you want to be notified only if the search results include greater than or equal to that number of messages or groups you set in the text box.
      • Fewer than. Choose if you want to be notified only if the search results include fewer than that number of messages or groups you set in the text box.
      • Fewer than or equal to. Choose if you want to be notified only if the search results include fewer than or equal to that number of messages or groups you set in the text box.
  3. Alert Type. Select Email. For other alert types, see Scheduled Searches
  4. Send email on failure to search owner. Selecting this option will send an email notification to the search owner if the Scheduled Search fails to run. To troubleshoot a failed Scheduled Search, see Why Would a Scheduled Search Fail and What Happens When a Scheduled Search Is Suspended.
  5. Recipients. Enter the recipients of your scheduled search email. Separate multiple email addresses with commas.
  6. Email Subject. You can use variables to customize the subject of your email. For more information, see Variables for email subject line below.
  7. Include in email. Select the features you want to include in your email results:  
    • Search Query. 
    • Result Set.  
    • Histogram. 
    • Results as a CSV attachment. The maximum CSV file size allowed is 5 MB or 1,000 results. 
  8. Click Save to add the search to the LibraryThe columns in an alert email are alphabetically ordered. To set the column order in the email alert, you can use the fields operator in your query.

Variables for email subject line

Variable Description
{{AlertCondition}} The condition that triggered the alert.
{{FireTime}} The time that the search ran.
{{NumRawResults}} The number of raw messages returned by the search. (There is a limit of 1,000 results.)
{{TimeRange}} The time range over which the search was run.
{{Results.fieldname}} The value returned from the search result for the specified field. For example, this payload specification:

{{Results.client_ip}} had {{Results.errors}} errors

Results in a subject line like this:

70.69.152.165 had 391 errors

If the payload specification returns more than one result, only the first is used.

Note that, in both the query and in the payload specification, fieldname must exactly match the field from your search, and must be all lower case, with no spaces. For example, customername and customer_name are valid, but CustomerName, Customer_Name, Customer Name are not.