Create an alert template

更新时间:
复制 MD 格式

Simple Log Service sends alert notifications based on alert templates.

Procedure

  1. Log on to the Simple Log Service console.

  2. Go to the Alert Template tab.

    1. In the Projects section, click a project.

    2. In the left-side navigation pane, click Alerts.

    3. On the Alert Center page, choose Notification Management > Alert Template.

  3. On the Alert Template tab, click Create.

  4. In the Add Alert Template dialog box, configure the following parameters and click OK.

    An alert template supports these notification methods: SMS, Voice, Email, DingTalk, WebHook-Custom, Notifications, WeCom, Lark, and Slack.

    Parameter

    Description

    ID

    The alert template ID. Must be unique within your Alibaba Cloud account.

    Name

    The name of the alert template.

    SMS

    You can configure the following parameters:

    Voice

    You can configure the following parameters:

    Email

    You can configure the following parameters:

    • Language: The notification language. Supported: Chinese and English.

    • Subject: The notification subject. Supports template variables.

    • Send Content: The notification content. Supports template variables. Description of template variables (New Version).

    DingTalk

    You can configure the following parameters:

    Webhook-Custom

    You can configure the following parameters:

    • Sending Mode: Supported modes: Single and Batch.

      For example, you enter { "project": "{{project}}", "alert_name": "{{alert_name}}"} in the Content field, and two alerts are triggered.

      • Single: Each alert is sent separately. The content is { "project": "project-1", "alert_name": "alert-1"} and { "project": "project-2", "alert_name": "alert-2"}.

      • Batch: Alerts are sent in a single batch. The content is [{ "project": "project-1", "alert_name": "alert-1"}, { "project": "project-2", "alert_name": "alert-2"}].

        • In Batch mode, if you set Maximum number of items sent in a group to N, only the first N alerts in a merge set are sent.

        • In Batch mode, parsable JSON content is sent in JSON format. Otherwise, it is sent as a string array.

    • Send Content: The notification content. Supports template variables. Description of template variables (New Version).

    Note

    The default request header is Content-Type: application/json;charset=utf-8. To use a different format, specify a custom request header in the notification channel. Webhook-Custom.

    Notifications

    You can configure the following parameters:

    WeCom

    You can configure the following parameters:

    Lark

    You can configure the following parameters:

    Slack

    You can configure the following parameters:

    EventBridge

    You can configure the following parameters:

    Function Compute

    You can configure the following parameters:

    • Sending Mode: Supported modes: Single and Batch.

      For example, you enter { "project": "{{project}}", "alert_name": "{{alert_name}}"} in the Content field, and two alerts are triggered.

      • Single: Each alert is sent separately. The content is { "project": "project-1", "alert_name": "alert-1"} and { "project": "project-2", "alert_name": "alert-2"}.

      • Batch: Alerts are sent in a single batch. The content is [{ "project": "project-1", "alert_name": "alert-1"}, { "project": "project-2", "alert_name": "alert-2"}].

        • In Batch mode, if you set Maximum number of items sent in a group to N, only the first N alerts in a merge set are sent.

        • In Batch mode, parsable JSON content is sent in JSON format. Otherwise, it is sent as a string array.

    • Send Content: The notification content. Supports template variables. Description of template variables (New Version).