Create a rule
Open Alerts and click New. Start from a template or from an empty form.
A template fills in the column names of the table you pick. The Error Spike query looks like this before the columns are filled in:
- Name and Description.
- Data Source and Table: where the query runs.
- Query: a SQL query against the table. Give the column you want to compare an alias, such as
cnt. - Schedule: Interval runs every N minutes or hours. Daily, Weekdays, and Weekly run at a time you choose. Custom takes a set of days and a time, or a 5-field cron expression in UTC.
- Condition: Any rows returned, Value above, Value above or equal to, Value below, Value below or equal to, Value equal to, Value not equal to, Row count above, or Row count below. A value condition reads the Field you name, for example
cnt, from the first row. Every condition except Any rows returned takes a Threshold. - Notification Channels: one or more channels from the Notification Channels page.
- Enable AI Summary: adds a summary written by a model to the notification. You set the Prompt, the Model, and Max Tokens. The prompt can use
{{alertName}},{{resultRowCount}}, and{{resultRows}}.
How rules run
- Sherlock checks every minute which rules are due, runs their queries, and evaluates the condition.
- A rule that triggers sends one notification per channel.
- The Alerts table shows Last Run and Last Triggered for each rule.
Notification channels
Open Notification Channels in the sidebar to add a channel. Each channel has a Display Name and one of three types.Related topics
Logs
The query syntax for the lines a rule counts.
Ask an AI assistant
Ask which errors matter before you write a rule for them.

