Torch Log Service
Variable | Type | Description | Example value |
Variable | Type | Description | Example value |
{{AccountID}} | String | The account ID associated with the alarm policy. |
|
{{UserName}} | String | The username of the account associated with the alarm policy. It is not recommended to use this variable in content templates for Lark, DingTalk, WeCom, and custom Webhook channels. If so, the value of this variable remains empty in these channels. |
|
{{ProjectName}} | String | The project that triggered the alarm. |
|
{{AlarmTopicName}} | String | The log topic that triggered the alarm. |
|
{{NotifyMsg}} | String | The original content in the additional notification content of the alarm policy is replaced with the rendered content.
|
|
{{Message}} | String | Original content entered in the additional notification content field of the alarm policy. The entered alarm variables are not parsed; the original content is sent directly. |
|
{{Region}} | String | The region where the project associated with the alarm policy is located. |
|
{{Alarm}} | String | Alarm policy name. |
|
{{AlarmID}} | String | Alarm policy ID. |
|
{{ExecuteQuery}} | []String | Query statements configured in the alarm policy. |
|
{{Duration}} | String | Alarm duration. The unit is minutes. |
|
{{Condition}} | String | Trigger conditions configured in the alarm policy. |
|
{{HappenThreshold}} | Integer | The alarm cycle configured in the alarm policy for sending alarms. |
|
{{Topics}} | []String | The monitoring targets configured in the alarm policy refer to all log topics currently monitored by this alarm policy. |
|
{{TopicIds}} | []String | The IDs of all log topics monitored by the alarm policy. |
|
{{StartTime}} | String | The time when the alarm is first triggered in a complete alarm event. A complete alarm event starts from alarm triggered and ends at alarm recovery. Alarm recovery marks the end of this alarm event. |
|
{{StartTimeUnix}} | Integer | The timestamp of the first alarm trigger in the event. Format: second-level UNIX timestamp. |
|
{{NotifyTime}} | String | The notification time for this alarm. |
|
{{NotifyTimeUnix}} | Integer | The timestamp for this alarm notification. Format: second-level UNIX timestamp. |
|
{{NotifyType}} | Integer | Alarm notification types.
|
|
{{Severity}} | String | The alarm level configured in the alarm policy represents the severity of the alarm.
|
|
{{ConsecutiveAlertNums}} | Integer | Number of consecutive alarms. |
|
{{TriggerParams}} | []String | The actual values of the fields in the trigger conditions when the alarm is triggered. |
|
{{DetailUrl}} | String | Link to the alarm policy execution information page. |
|
{{QueryUrl}} | String | Link to the query and analysis page for the first execution statement in the alarm policy. |
|
{{QueryResult}} | [][]Object | Execution results of the query and analysis statement triggered by an alarm.
| |
{{QueryResultStr}} | []String | Returns QueryResult results as a string array. Index access for {{QueryLogStr[0]}} is not supported currently. | |
{{QueryLog}} | [][]Object | Original log information matched by query conditions in the execution statement. Filtering conditions from analysis statements are not included.
| |
{{QueryLogStr}} | []String | Returns QueryLog results as an array of strings.
| |
{{QueryStartTime}} | Integer | Start time of the last execution statement in the alarm policy.
|
|
{{QueryEndTime}} | Integer | The end time of the last execution statement in the alarm policy.
|
|
{{Results}} | []QueryData | Query parameters and intermediate results.
|
|
{{FireResults}} | []Object | The data that triggered the alarm, which is the result after the collection operation.
|
|
{{FireResultsCount}} | Integer | Total amount of data after collection operations on the results returned by query and analysis that trigger the alarm. May exceed 100. |
|
{{SignInUrl}} | String |
|
Variable | Data type | Description | Example |
Variable | Data type | Description | Example |
TopicId | String | Target log topic ID for query and analysis. | fed25df2-cc27-4b0a-8ad2-773aef61**** |
Query | String | Query and analysis statement. | error | select count(*) as errorCount |
StartTime | Integer | Query start time. The format is a 10-digit Unix time stamp. | 1699411640 |
EndTime | Integer | Specify the query end time. The format is a 10-digit Unix time stamp. | 1699412200 |
RawResults | []Object | Actual query results.
| [{"cnt":"0"}] |
RawResultsCount | Integer | The total number of actual query records may exceed 100. | 1 |
FireResult | Object | The log content that triggered the alarm. Multiple original logs may trigger an alarm policy. This parameter only returns the first original log that triggers the alarm. | {"cnt":"0"} |
Example value | Field | Output result |
Example value | Field | Output result |
Variable | {{toJson(FireResults)}} | {"a":123,"b":123} |
Add filter | {{toJson(FireResults)|escapejs}} | \u007b\u0022\u0061\u0022\u003a\u0031\u0032\u0033\u002c\u0022\u0062\u0022\u003a\u0031\u0032\u0033\u007d |
Filter | Description | Example |
Filter | Description | Example |
escape | Automatically escape special characters. If special characters that should be escaped are not escaped in the received alarm notifications, this filter can be used to forcefully escape all output content of specified strings or specified variables. |
|
escapejs | Encode special characters using Unicode. If alarm notification content contains special characters that require Unicode encoding, you can use this filter to encode the special characters in specific strings or variables with Unicode. For more details, see Alarm notification content contains special characters, how to deal with it?. |
|