Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Log Tank Service/ User Guide/ Log Alarms/ Configuring Log Alarm Action Rules/ Creating a Message Template on the LTS Console

Creating a Message Template on the LTS Console

Updated on 2025-01-24 GMT+08:00

A message template defines the format of alarm notification messages sent to subscribers. LTS provides built-in message templates. Subscribers can select templates based on protocols. If the template of a specified protocol does not exist, the built-in template of that protocol is used to send messages to subscribers. When using a message template to send alarm notification messages, the system automatically replaces the template variables with the content in the alarm rule.

Creating a Message Template

  1. Log in to the LTS console.
  2. Choose Log Alarms in the navigation pane and click the Alarm Action Rules tab.

    NOTE:
    By default, LTS provides the following built-in message templates. If no message content is configured in your selected template, LTS uses a built-in template instead.
    • keywords_template (Chinese): keyword alarm template
    • keywords_template (English): keyword alarm template
    • sql_template (Chinese): SQL alarm template
    • sql_template (English): SQL alarm template

  3. Click Create on the Message Templates tab page. On the displayed page, set the required parameters.

    NOTE:
    • The email content supports HTML tags and message preview.
    • Templates such as WeCom, Lark, and DingTalk support markdown syntax and message preview.
    • You can create up to 100 message templates for AOM and LTS. If there are already 100 templates, delete unnecessary templates before creating a new one.
    Table 1 Message template parameters

    Parameter

    Description

    Verification Rule

    Example

    Template Name

    Message template name.

    Include digits, letters, underscores (_), and hyphens (-). Do not start or end with an underscore or hyphen. (Max. 100 characters)

    LTS-test

    Description

    Description of the template.

    Include digits, letters, and underscores (_). Do not start or end with an underscore. (Max. 1,024 characters)

    -

    Message Header

    Default message header to be added in messages.

    • Chinese (Simplified)
    • English
    • English: "Dear user,"
    • "Dear user,"

    Notification method

    Notification method.

    • Email
    • SMS
    • HTTP/HTTPS
    • DingTalk
    • Lark
    • WeCom
    • Voice
      NOTE:

      The voice function is available only to whitelisted users. To use it, submit a service ticket.

    -

    Topic

    Message topic.

    Customize the topic name or use variables. (Max. 512 characters)

    Only email templates need a topic name.

    test

    Body

    Message content.

    Add Variable

    • Original rule name: ${event_name}
    • Alarm severity: ${event_severity}
    • Occurrence time: ${starts_at}
    • Occurrence region: ${region_name}
    • Huawei Cloud account: ${domain_name}
    • Alarm source: $event.metadata.resource_provider
    • Resource type: $event.metadata.resource_type
    • Resource ID: ${resources}
    • Alarm status: $event.annotations.alarm_status
    • Expression: $event.annotations.condition_expression
    • Current value: $event.annotations.current_value
    • Expression with a value: $event.annotations.condition_expression_with_value
    • Statistical period: $event.annotations.frequency
    • Rule name: $event.annotations.alarm_rule_alias
    • Frequency: $event.annotations.notification_frequency
    • Original log group name: $event.annotations.results[0].log_group_name
    • Original log stream name: $event.annotations.results[0].log_stream_name
    • Variables supported by keyword alarms:
      1. Query time: $event.annotations.results[0].time
      2. Query logs: (The maximum log size is 2 KB. If a log exceeds 2 KB, the extra part will be truncated and discarded.)

        $event.annotations.results[0].raw_results

      3. Query URL:

        $event.annotations.results[0].url

      4. Log group/stream name: $event.annotations.results[0].resource_id
        NOTE:

        Only the original name of the log group or log stream created for the first time can be added. The modified log group or log stream name cannot be added.

      5. Enterprise project ID of the log stream: $event.annotations.results[0].eps_id
      6. Query custom field: $event.annotations.results[0].fields.xxx
        NOTE:

        xxx indicates the structured fields and system fields (such as hostIP and hostName) of the raw logs. The maximum size of a log field is 1 KB. If a field exceeds 1 KB, the extra part will be truncated and discarded.

    • Variables supported by SQL alarms:
      1. Log group/stream names of chart 0: $event.annotations.results[0].resource_id
        NOTE:

        Only the original name of the log group or log stream created for the first time can be added. The modified log group or log stream name cannot be added.

        0 indicates the first chart, 1 indicates the second chart, and so on.

      2. Query statement of chart 0: $event.annotations.results[0].sql
      3. Query time of chart 0: $event.annotations.results[0].time
      4. Query URL of chart 0: $event.annotations.results[0].url
      5. Query log of chart 0: $event.annotations.results[0].raw_results
      6. Chart 0 Log Stream Enterprise Project ID: $event.annotations.results[0].eps_id

    Copy from Existing

    • keywords_template
    • sql_template
    • sql_template
    • keywords_template
    • Custom templates (created with variables)

    ${event_name}

    ${event_severity}

    ${starts_at}

    ${region_name}

  4. When the configuration is complete, click OK.

    NOTE:

    When creating a message template on the LTS console, if you are prompted that the creation fails because the template name is not unique, perform the following steps to rectify the fault:

    1. Check whether the message template name already exists.

      If yes, change the name. Message template names must be unique in both LTS and AOM because the two services share the same data source. If you have created a message template named test in AOM, you cannot create a message template with the same name in LTS.

    2. Check whether the number of message templates exceeds the quota.

      You can create up to 100 message templates for AOM and LTS. If there are already 100 templates, delete unnecessary templates before creating a new one.

Modifying a Message Template

  1. In the message template list, click Modify in the row that contains the target template, and modify the template according to Table 1. The template name cannot be modified.

    NOTE:

    Built-in message templates cannot be modified.

  2. Click OK.

Copying a Message Template

  1. In the message template list, click Copy in the row that contains the target template. Set a new template name.
  2. Click OK.

Deleting a Message Template

  1. In the message template list, click Delete in the Operation column of the target template.

    NOTE:

    Built-in message templates cannot be deleted.

  2. Click OK.

Deleting Message Templates in a Batch

  1. In the message template list, select the templates to be deleted and click Delete.
  2. Click OK.

Exporting Message Templates

  1. In the message template list, select the templates to be exported and click Export.
  2. Click Export all data to an XLSX file or Export selected data to an XLSX file. After the data is exported, you can view it on the local PC.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback