Scenario 1: Configure MySQL Single Condition Alert Rule
Value Fields
In the SQL query condition, select the column name you want as the value field for the query result. As shown below, I used count(*)
and gave it an alias count
, then used the alias count
as the value field to get the result of condition A.
Label Fields
Use the GROUP BY
field as the label field, and the alert will be grouped by this field.
Scenario 2: Apply Filters in WHERE Clause
As shown in the query statement below: count the active alerts with severity levels 1, 2, and 3.
SELECT COUNT(*) AS count FROM n9e_v6.alert_cur_event WHERE severity IN (1,2,3);
When the alert is triggered, only the count
value will be displayed.
Scenario 3: Apply Filters in WHERE Clause and Group Alerts
Set the query condition to group by severity
and set severity
as the label field.
SELECT severity as severity, COUNT(*) AS count FROM n9e_v6.alert_cur_event WHERE severity IN (1,2,3) GROUP BY severity;
By comparing the alert time and data preview, you can see that after grouping by severity
, the alerts are grouped by the label field.
Scenario 4: Multiple Query Condition Expression Mode
Configure multiple SQL query conditions and apply threshold alerting to the results of both query conditions.