All Products
Search
Document Center

Simple Log Service:Configure an interaction occurrence for a dashboard to perform drill-down analysis

Last Updated:Nov 18, 2024

If an exception is identified on a dashboard, you can configure an interaction occurrence to perform drill-down analysis in an efficient manner. For example, you can select Open Logstore, Open Trace Analysis, or Open Dashboard from the Add Event drop-down list to configure an interaction occurrence and identify the root cause of the exception. This topic describes the supported types of interaction occurrences. This topic also describes how to configure an interaction occurrence for a dashboard.

Feature description

If an exception is identified on a dashboard, you can configure an interaction occurrence to perform drill-down analysis in an efficient manner. You can configure the following types of interaction occurrences: Open Logstore, Open Dashboard, Open Saved Search, Create Custom HTTP URL, Open Trace Details, and Open Full-stack Observability Trace Details.

In this example, an NGINX access log is used as the sample log, and a dashboard named HTTP Status Codes is added. After you click the part that corresponds to HTTP status code 200 in the pie chart on the dashboard, you are navigated to the related Logstore, and you can view the logs of requests for which HTTP status code 200 is returned. The query time range of the Logstore is the same as the query time range of the dashboard.

  1. Add a pie chart: Configure the query time range, Logstore, and query statement for the chart.

  2. Configure an interaction occurrence: Configure an Open Logstore interaction occurrence for the pv field in the pie chart on the dashboard and add the ${{status}} variable when you configure the interaction occurrence. The ${{status}} variable is used to dynamically modify the related parameter in the specified query statement. This way, you can view the logs of requests for which the status code specified by the ${{status}} variable is returned in the specified Logstore. For more information, see Use variables to dynamically modify the parameters of a query statement.

Simple Log Service supports the following types of interaction occurrences. For more information about how to configure an interaction occurrence, see the "Procedure" section of this topic.

Open Logstore

You can select Open Logstore from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the page of the Logstore that is created.

  • Prerequisites

    A Logstore is created. For more information, see Create a Logstore.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Select Project

    The project to which the Logstore belongs.

    Select Logstore

    The Logstore that is created. When the interaction occurrence is triggered, you are navigated to the page of the Logstore.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Open Logstore to trigger the interaction occurrence.

    Time Range

    The time range of the data to query in the Logstore.

    Inherit Filter Condition

    If you turn on Inherit Filter Condition, the filter conditions that are added to the current dashboard are synchronized to the Logstore. Then, you can enter a query statement after the filter conditions. The query statement and the filter conditions are evaluated by using a logical AND.

    Filter Statement

    The filter statement, which can be synchronized to the Logstore. Then, you can enter a query statement after the filter statement. The two statements are evaluated by using a logical AND.

    You can click Add Variable to add variables to the filter statement. The following list describes important system variables:

    • ${{__start_time__}}: the query start time.

    • ${{__end_time__}}: the query end time.

    • ${{__interval__}}: the interval between two query requests. Unit: seconds.

    • ${{__project__}}: the name of the project to query.

    After you add the variable, the value of the variable is used as a filter condition.

Open Dashboard

You can select Open Dashboard from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the page of the destination dashboard.

  • Prerequisites

    A destination dashboard is created and a chart is created in the destination dashboard. For more information, see Add a chart to a dashboard.

    If you want to configure a variable for the interaction occurrence, make sure that the variable is configured in the query statement for the chart that you create in the destination dashboard. For more information, see Use variables to dynamically modify the parameters of a query statement.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Select Project

    The project to which the destination dashboard belongs.

    Select Dashboard

    The destination dashboard. When the interaction occurrence is triggered, you are navigated to the page of the destination dashboard.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Open Dashboard to trigger the interaction occurrence.

    Time Range

    The time range of the data to query in the destination dashboard.

    Inherit Filter Condition

    If you turn on Inherit Filter Condition, the filter conditions that are added to the current dashboard are synchronized to the destination dashboard.

    Inherit Variable

    If you turn on Inherit Variable, the variables that are configured for the current dashboard are synchronized to the destination dashboard.

    Filter Statement

    The filter statement, which can be synchronized to the destination dashboard.

    You can add a variable to the filter statement.

    You can click Add Variable to add variables to the filter statement. The following list describes important system variables:

    • ${{__start_time__}}: the query start time.

    • ${{__end_time__}}: the query end time.

    • ${{__interval__}}: the interval between two query requests. Unit: seconds.

    • ${{__project__}}: the name of the project to query.

    After you add the variable, the value of the variable is used as a filter condition.

    Dynamic Variables

    Simple Log Service allows you to synchronize the variable that you specify to the destination dashboard.

    • Dynamic variable name: the name of the variable.

    • Dynamic variable value-related column: the column from which the system dynamically retrieves a value for the dynamic variable. The value is then synchronized to the destination dashboard.

    Note

    You can add up to five dynamic variables.

    Static Variables

    Simple Log Service allows you to synchronize the variable that you specify to the destination dashboard.

    • Static variable name: the name of the variable.

    • Static variable value: the fixed value of the static variable. The value is directly synchronized to the destination dashboard.

    Note

    You can add up to five static variables.

Create Custom HTTP URL

You can select Create Custom HTTP URL from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the page that you specify.

  • Prerequisites

    An HTTP URL is available.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Protocol

    The protocol for the URL.

    URL

    The URL of the page to which you want to be navigated.

    You can add the following system variables of Simple Log Service to the URL. Example: https://sls.console.aliyun.com/lognext/project/${{__project__}}/logsearch/test.

    • ${{__start_time__}}: the query start time.

    • ${{__end_time__}}: the query end time.

    • ${{__interval__}}: the interval between two query requests. Unit: seconds.

    • ${{__project__}}: the name of the project to query.

    Transcode

    If you turn on Transcode, the URL is encoded.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Create Custom HTTP URL to trigger the interaction occurrence.

Open Saved Search

You can select Open Saved Search from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the page of the saved search that is created.

  • Prerequisites

    A saved search is created. For more information, see Saved search.

    If you want to configure a variable for the interaction occurrence, make sure that the variable is configured in the query statement of the saved search. For more information, see Use variables to dynamically modify the parameters of a query statement.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Select Project

    The project to which the saved search belongs.

    Select Saved Query

    The saved search that is created. When the interaction occurrence is triggered, you are navigated to the page of the saved search.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Open Saved Search to trigger the interaction occurrence.

    Time Range

    The time range of the data to query on the page of the saved search.

    Inherit Filter Condition

    If you turn on Inherit Filter Condition, the filter conditions that are added to the current dashboard are synchronized to the saved search. Then, you can enter a query statement after the filter conditions. The query statement and the filter conditions are evaluated by using a logical AND.

    Filter Statement

    The filter statement, which can be synchronized to the saved search. Then, you can enter a query statement after the filter statement. The two statements are evaluated by using a logical AND.

    You can add a variable to the filter statement. After you add the variable, the value of the variable is used as a filter condition.

    Dynamic Variables

    Simple Log Service allows you to modify the query statement of the saved search by using variables. If the variable that you specify for the Dynamic Variables parameter is the same as a variable in the query statement of the saved search, the variable in the query statement is replaced with a value of the column that you specify for the Dynamic Variables parameter.

    • Dynamic variable name: the name of the variable.

    • Dynamic variable value-related column: the column from which the system dynamically retrieves a value for the dynamic variable. The value is used to replace the variable in the query statement of the saved search.

    Note

    You can add up to five dynamic variables.

    Static Variables

    Simple Log Service allows you to modify the query statement of the saved search by using variables. If the variable that you specify for the Static Variables parameter is the same as a variable in the query statement of the saved search, the variable in the query statement is replaced with the value that you specify for the Static Variables parameter.

    • Static variable name: the name of the variable.

    • Static value: the fixed value of the static variable. The value is used to replace the variable in the query statement of the saved search.

    Note

    You can add up to five static variables.

Open Trace Analysis

You can select Open Trace Analysis from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the analysis page of the trace instance that is created.

  • Prerequisites

    A trace instance is created and traces are collected to Simple Log Service. For more information, see Overview.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Open Trace Analysis to trigger the interaction occurrence.

    Time Range

    The time range of the data to query on the analysis page of the trace instance.

    Trace Instance

    The trace instance that is created. When the interaction occurrence is triggered, you are navigated to the analysis page of the trace instance.

    Filter Statement

    The filter statement, which can be synchronized to the analysis page of the trace instance.

    You can add a variable to the filter statement. After you add the variable, the value of the variable is used as a filter condition.

Open Trace Details

You can select Open Trace Details from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the details page of the trace instance that is created.

  • Prerequisites

    A trace instance is created and traces are collected to Simple Log Service. For more information, see Overview.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Open Trace Details to trigger the interaction occurrence.

    Time Range

    The time range of the data to query on the details page of the trace instance.

    Trace Instance

    The trace instance that is created. When the interaction occurrence is triggered, you are navigated to the details page of the trace instance.

    Trace ID

    The ID of the trace.

    Span ID

    The ID of the span.

Open Full-stack Observability Trace Analysis

You can select Open Full-stack Observability Trace Analysis from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the trace analysis page of the Full-stack Observability instance that is created.

  • Prerequisites

    A Full-stack Observability instance is created. For more information, see Create an instance.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Open Full-stack Observability Trace Analysis to trigger the interaction occurrence.

    Time Range

    The time range of the data to query on the trace analysis page of the Full-stack Observability instance.

    Full-stack Observability Instance

    The Full-stack Observability instance that is created. When the interaction occurrence is triggered, you are navigated to the trace analysis page of the Full-stack Observability instance.

    Filter Statement

    The filter statement, which can be synchronized to the trace analysis page of the Full-stack Observability instance.

    You can add a variable to the filter statement. After you add the variable, the value of the variable is used as a filter condition.

    You can click Add Variable to add variables to the filter statement. The following list describes important system variables:

    • ${{__start_time__}}: the query start time.

    • ${{__end_time__}}: the query end time.

    • ${{__interval__}}: the interval between two query requests. Unit: seconds.

    • ${{__project__}}: the name of the project to query.

    After you add the variable, the value of the variable is used as a filter condition.

Open Full-stack Observability Trace Details

You can select Open Full-stack Observability Trace Details from the Add Event drop-down list to configure an interaction occurrence. When the interaction occurrence is triggered, you are navigated to the trace details page of the Full-stack Observability instance that is created.

  • Prerequisites

    A Full-stack Observability instance is created. A trace instance is created and traces are collected to Simple Log Service. For more information, see Create an instance and Overview.

  • Parameters

    Parameter

    Description

    Custom Name

    The name of the interaction occurrence.

    Open New Window

    If you turn on Open New Window, a new page is displayed when you click Open Full-stack Observability Trace Details to trigger the interaction occurrence.

    Time Range

    The time range of the data to query on the trace details page of the Full-stack Observability instance.

    Full-stack Observability Instance

    The Full-stack Observability instance that is created. When the interaction occurrence is triggered, you are navigated to the trace details page of the Full-stack Observability instance.

    Trace ID

    The ID of the trace.

    Span ID

    The ID of the span.

Procedure

Example 1: Configure an Open Logstore interaction occurrence

1. Add a pie chart

1.1 Add a dashboard

  1. Add a dashboard: Log on to the Simple Log Service console and select the project that you want to manage. On the Dashboard > Dashboards page, add a dashboard named HTTP Status Codes.

    image

1.2 Add a chart

  1. Click Add Chart.

    image

  2. Configure and save a chart.

    1. On the left side of the page that appears, configure the query time range, Logstore, and query statement for the chart.

    2. On the right side of the page that appears, select a chart type in the Chart Types section and configure the Category and Value Column parameters in the Query and Analysis Configurations section. After you complete the configuration, click Apply in the upper part of the page to view the configuration effects of the chart. Then, click OK in the upper-right corner of the page to save the chart.

      * | 
      select 
        count(1) as pv ,status 
      group by 
        status

2. Configure an interaction occurrence

In this example, an Open Logstore interaction occurrence is configured. After you click the part that corresponds to HTTP status code 200 in the pie chart on the dashboard, you are navigated to the related Logstore, and you can view the logs of requests for which HTTP status code 200 is returned. The query time range of the Logstore is the same as the query time range of the dashboard.

2.1 Configure an interaction occurrence for a field

  1. On the right side of the page, click the Interaction Occurrences tab. Then, click Add Field and select the field that you want to manage from the drop-down list.

    image

  2. Click Add Event and select Open Logstore from the drop-down list. In the Open Logstore dialog box, configure the Select Logstore parameter and the dynamic variables in the Filter Statement field.

    The Select Logstore parameter specifies the Logstore whose data you want to query. The Time Range parameter specifies the time range of the query statement. The Filter Statement parameter specifies the query statement displayed on the query and analysis page of the Logstore.

    image

2.2 Save the chart and the dashboard

  1. In the upper-right corner of the Edit Chart page, click OK.

    image

  2. In the upper-right corner of the dashboard page, click Save.

2.3 Verify the interaction occurrence

Click the part that corresponds to HTTP status code 200 in the pie chart on the dashboard. In the popover that appears, click Open Logstore. Then, you are navigated to the query and analysis page of the Logstore and the query statement on the page is status: 200. The query time range is Two Days Before, which is the same as the query time range of the dashboard.

image

Example 1: Configure an Open Dashboard interaction occurrence

This section provides an example on how to configure an interaction occurrence by using a Logstore named website_log that stores NGINX access logs and two dashboards named RequestMethod and destination_drilldown.

  • Add a table of request methods to the RequestMethod dashboard and configure an interaction occurrence for the table to open the destination_drilldown dashboard.

  • Add a line chart that displays the trend of page views (PVs) over time to the destination_drilldown dashboard.

After the configuration is complete, you can click a request method on the RequestMethod dashboard to access the destination_drilldown dashboard. Then, you can view the trend of PVs over time on the destination_drilldown dashboard. You can perform the following operations to configure the interaction occurrence:

  1. Add a line chart that displays the trend of PVs over time to the destination_drilldown dashboard.

    Enter the following query statement. ${{method|PUT}} specifies a variable. For more information, see Add a chart to a dashboard.

    request_method: ${{method|PUT}} | SELECT __time__ - __time__ %60 AS time, COUNT(1) AS PV GROUP BY time ORDER BY time

    交互事件

  2. Add a table of request methods to the RequestMethod dashboard and configure an interaction occurrence for the table.

    Enter the query statement shown in the following figure. For more information, see Add a chart to a dashboard.

    交互事件

    Configure the interaction occurrence based on the following figure.

    • Set the Select Dashboard parameter to destination_drilldown.

    • Add a dynamic variable named method and select the request_method column.

    交互事件

  3. Verify the interaction occurrence.

    On the RequestMethod dashboard, click GET and click Open Dashboard. You are navigated to the destination_drilldown dashboard.

    请求方法

    The trend of PVs for GET requests over time is displayed in a line chart.

    跳转后仪表盘