Updated on 2024-06-28 GMT+08:00

Creating a Log Metric Rule

You can create log metric rules to extract ELB log data reported to LTS as metrics and monitor them on the metric browsing and dashboard pages.

Precaution

  • To use business monitoring, enable this function in Menu Settings. For details, see Menu Settings.
  • You can create a maximum of 100 log metric rules. The total number of metrics added to all rules cannot exceed 100.

Creating a Log Metric Rule

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Business Monitoring (Beta) > Business Metrics.
  3. Click next to Log Metric Rules.
  4. Set parameters to ingest ELB logs reported to LTS to AOM. For details, see Table 1.

    Figure 1 Ingesting logs
    Table 1 Log ingestion parameters

    Parameter

    Description

    Ingestion Rule

    Enter 1 to 100 characters and do not start with an underscore (_) or hyphen (-). Only letters, digits, hyphens, and underscores are allowed.

    Log Type

    ELB log is selected by default and cannot be changed.

    Application

    Select a created application from the drop-down list.

    Log Group

    Select a created log group from the drop-down list. If no log group is available, create one by referring to Collecting Logs from ELB.

    Log Stream

    Select a created log stream from the drop-down list. Click Preview Log to view the log data contained in the log stream.

    Log Structuring

    Click Structure to structure the selected logs. By default, structured fields are displayed in the list below.

  5. Click Next.
  6. Set metric information.

    1. Click Add Metric to add metrics for the log metric rule. For details, see Table 2.
      Figure 2 Adding a metric
      Table 2 Metric configuration parameters

      Category

      Parameter

      Description

      Basic Info

      Metric Name

      The name consists of prefix aom_business_elb_ and custom content.

      Metric Alias

      (Mandatory) Enter an alias.

      Query Metric

      Search By

      Only SQL query is supported.

      Query Statement

      Enter an SQL query statement in the text box and click to adjust the SQL statement format. Click to view the syntax of SQL statements.

      Query Period

      Select a period from the drop-down list. Options: Last minute, Last 10 minutes, Last 15 minutes, Last hour, Last 6 hours, Last day, and Last week.

      Define Metric

      Metric Value

      Select a value from the drop-down list. Only numeric fields can be selected.

      Metric Dimension

      Select a value from the drop-down list.

    2. Click OK.
    3. (Optional) Click Add Metric to add more metrics for the rule.

  7. Click OK.

    The created log metric rule is displayed in the rule list on the left.

More Operations

After creating a log metric rule, perform the operations listed in Table 3 if needed.

Table 3 Related operations

Operation

Description

Querying a log metric rule

  1. In the log metric rule list on the left, click a rule name.
  2. In the right pane, view the enabling status, log type, and metric of the rule.

Disabling a log metric rule

  1. In the log metric rule list on the left, click a rule name.
  2. In the upper right corner of the page, click Disable.

Editing a log metric rule

  1. In the log metric rule list on the left, click a rule name.
  2. In the upper right corner of the page, choose > Edit. For details, see Creating a Log Metric Rule.

Deleting a log metric rule

  1. In the log metric rule list on the left, click a rule name.
  2. In the upper right corner of the page, choose > Delete.

Adding a metric

  1. In the log metric rule list on the left, click a rule name.
  2. In the right pane, click Add Metric. For details, see 6.

Editing a metric

  1. In the log metric rule list on the left, click a rule name.
  2. In the right pane, select a metric access card and click . For details, see 6.

Deleting a metric

  1. In the log metric rule list on the left, click a rule name.
  2. In the right pane, select a metric access card and click .

Searching for a metric

  1. In the log metric rule list on the left, click a rule name.
  2. On the right of the page, enter a rule name keyword in the search box next to Add Metric and click .