Create a job

Updated at:

Simple Log Service provides a drill-down analysis feature for automated and intelligent root cause analysis of multi-dimensional time series data. The root cause analysis results identify which dimensions, single or combined, of the time series data are causing anomalies. This narrows the scope for troubleshooting. This topic describes how to create a drill-down analysis job.

Prerequisites

  • Time series data is collected in the source Logstore. For more information, see Data collection overview.

  • Indexes are configured for the source Logstore. For more information, see Create indexes.

  • An intelligent anomaly detection instance is created. For more information, see Create an instance.

Procedure

  1. Log on to the Simple Log Service console.

  2. Go to the job creation page.

    1. In the Log Application section, on the Artificial Intelligence for IT Operations tab, click Intelligent Anomaly Detection.

    2. In the instance list, click the target instance.

    3. In the left navigation pane, choose Other Tasks > Drill-down Analysis.

    4. In the Drill-down Analysis Job section, click Create Now.

  3. In the Basic Information step of the Create Drill-down Analysis Job wizard, you can configure the following parameters and click Next.

    Parameter

    Description

    Job Name

    Set the name of the drill-down analysis job.

    Role

    If you granted the required permissions when you created the instance, the ARN of the AliyunLogETLRole role is automatically displayed.

    Logstore

    The destination Logstore. The value is fixed to internal-ml-log.

  4. In the Data Configuration step of the Create Drill-down Analysis Job wizard, you can configure the metric data and event source.

    1. In the Metric Data Configuration section, set the following parameters.

      The following code provides an example of a query statement. For more information, see Query overview and Query and analysis overview.

      * and __tag__ :__data_type__: metric |
       select
       (__time__-__time__ % 300) as time,
       cast(json_extract(attributes, '$.attr_1') as varchar) as attr_1,
       cast(json_extract(attributes, '$.attr_2') as varchar) as attr_2,
       cast(json_extract(attributes, '$.attr_3') as varchar) as attr_3,
       cast(json_extract(attributes, '$.attr_4') as varchar) as attr_4,
       cast(json_extract(attributes, '$.attr_5') as varchar) as attr_5,
       sum(cast(json_extract(metrics, '$.m') as double)) as metric
       FROM log
       group by
       time, attr_1, attr_2, attr_3, attr_4, attr_5
       limit
       100000

      Parameter

      Description

      Region

      The region where the selected Project resides. This parameter is displayed after you select a Project.

      Project

      Select the Project where the Logstore or Metricstore resides.

      Logstore Type

      Select the Logstore type based on where the multi-dimensional metric data is stored.

      • If your multi-dimensional metric data is stored in a Logstore, select Logstore.

      • If your multi-dimensional metric data is stored in a Metricstore, select Metricstore.

      Source Logstore

      If you set Logstore Type to Logstore, select the source Logstore where your multi-dimensional metric data is stored.

      Metricstore

      When Logstore Type is set to Metricstore, select the target Metricstore for your multi-dimensional metric data.

      Time

      The field in the source data that indicates the time column. Aggregate data at a granularity of one minute or more.

      Granularity

      The interval at which to pull source data, in seconds. Set this to a multiple of the data aggregation granularity.

      Dimension

      The field in the source data that indicates the data dimension.

      Metric

      The field in the source data that indicates the data metric.

      Aggregation

      If you add multiple metrics, set the expression for the aggregate operation.

    2. (Optional) In the Event Data Configuration section, click Add Event Configuration.

      The event data configuration extracts event sequences.

      Note

      Click Add Event Configuration to add multiple event configurations.

      Set Logstore Type to Logstore, and select aiops-2019-metrics for Source Logstore. Enter a query statement in the editor and click Query. After you confirm that the result is normal, set Time to time and set Event to status at the bottom.

      The following code provides an example of a query statement. For more information, see Query overview and Query and analysis overview.

      * | select
       cast(to_unixtime(time) as bigint) as time,
       'aiops' as entity,
       diff [1] as curr,
       diff [2] as prev,
       abs(diff [3] -1) as ratio,
       if(abs(diff [3] - 1) > 0.2, 1, 0) as status
       FROM (
       select time, ts_compare(metric, 86400) as diff
       FROM (
       select
       date_trunc('minute', __time__) AS time,
       sum(cast(json_extract(metrics, '$.m') as double)) as metric
       FROM log
       group by time
       ) 
       group by time
       )
       limit 10000

      Parameter

      Description

      Event Source Name

      Set the name of the event source.

      Region

      The region where the selected Project resides. This parameter is displayed after you select a Project.

      Project

      Select the Project where the Logstore or Metricstore resides.

      Logstore Type

      Select the Logstore type based on where the event data is stored.

      • If your event data is stored in a Logstore, select Logstore.

      • If your event data is stored in a Metricstore, select Metricstore.

      Source Logstore

      If you set Logstore Type to Logstore, select the source Logstore where your event data is stored.

      Metricstore

      When Logstore Type is set to Metricstore, you must select the target Metricstore to store your event data.

      Time

      The field in the source data that indicates time.

      Event

      The field in the source data that indicates the event.

      An anomaly is triggered if the value in the event column is a positive number or true.

    3. Click Next.

  5. In the Algorithm Configuration step of the Create Drill-down Analysis Job wizard, configure the parameters for the drill-down analysis algorithm and the scheduled time for the job. Then, click Finish.

    Parameter

    Description

    Observation Length

    The number of recent time series data points. The drill-down analysis job predicts the value of the next data point, which is the expected value, based on the specified observation length. For example, if you set this parameter to 5, the job predicts the next data point based on the last 5 data points.

    The drill-down analysis job determines whether a dimension combination is the root cause of an anomaly based on the deviation between the metric value and the expected value for that dimension combination.

    Confidence Level

    In general, a higher confidence level means the job analyzes more data and finds a more accurate root cause, but the algorithm takes longer to run.

    Data Latency

    The maximum latency for data to be written to the Logstore. In most cases, set this to 30 seconds or 60 seconds.

    Time Range

    Set the start time for the drill-down analysis job.

Analysis results

After a drill-down analysis job is created, you can click the job in the job list to view its details. You can filter by event source, event time, and time to view the root cause analysis results for a specific event.

Filter condition

Description

Time

Filter by time to view the analysis results of the drill-down analysis job for the corresponding time period.

Event Source

Filter by event source to view the corresponding events.

Event Time

Filter by the time of occurrence to view the corresponding events.

After you select an event, potential root cause candidates are displayed. You can select the checkboxes of these candidates to view their impact on the metric sequence.

Related operations

  • Modify a drill-down analysis job

    Find the job in the drill-down analysis job list and click the icon to modify it.

  • Delete a drill-down analysis job

    Find the job in the drill-down analysis job list and click the icon to delete it.

    Warning

    A drill-down analysis job cannot be recovered after it is deleted. Proceed with caution.

  • Manage event sources

    After you create a drill-down analysis job, click the job in the list. This opens the Event Data Management page, where you can add, delete, or update event sources.