Overview
Simple Log Service lets you set alerts for query or analysis results. After you set an alert, Simple Log Service periodically checks the query or analysis results. If a result meets the specified conditions, Simple Log Service sends an alert notification to enable real-time service status monitoring.
Limits
The following table describes the limits of the alerting feature in Simple Log Service.
| Limit | Description |
| Combined Query | You can associate 1 to 3 queries. |
| String | If a log field is longer than 1,024 characters, Simple Log Service truncates the field to the first 1,024 characters for calculation. |
| Conditional expression | The following limits apply to conditional expressions:
|
| Query interval | The time span for each query statement cannot exceed 24 hours. |
| Voice call alert | If a voice call is not answered, it is not redialed. A text message notification is sent instead. A charge is incurred for each voice call attempt, regardless of whether it is answered. The fallback text message does not incur extra fees. |
Query statements in alerts
- Search statements: Return log data that matches the search condition. For more information, see Query overview.For example, to query for logs that contain error in the last 15 minutes, the search statement is error. Assume 154 results are returned. Each log is a key-value pair. You can set an alert rule based on the value of a specific key.Note If a query returns more than 100 results, the alert rule evaluates only the first 100 results. An alert is triggered if any of these logs match the alert rule.
- Search and analysis statements: Compute the log data that matches the search condition and return a calculation result. For more information, see Query and analysis overview.
For example, to calculate the percentage of logs where the status code is ok, the search and analysis statement is * | select sum(case when status='ok' then 1 else 0 end) *1.0/count(1) as ratio. If you set the trigger condition to ratio < 0.9, an alert is triggered when the percentage of logs with an ok status code falls below 90%.
Billing
The Simple Log Service alert notification feature was upgraded on December 7, 2020. This upgrade removed the daily limit of 99 notifications for text messages, voice calls, and emails. Text message and voice call notifications are now charged per call, while email notifications remain free. For more information, see Billable items of the pay-by-feature mode.
Some ISPs may split long text messages, such as those over 70 characters, into multiple messages. If your message content is too long, you may receive multiple messages, but SLS charges for only one notification.