All Products
Search
Document Center

Simple Log Service:Configure a data conversion rule of the Connect type for two tables

Last Updated:Oct 28, 2024

You can configure a data conversion rule of the Connect type for two tables on a dashboard to join the tables for query and analysis.

Prerequisites

Solution

image

  1. Query and analyze data: You can query and analyze the collected logs in the Simple Log Service console. For example, you can retrieve logs, aggregate logs, and collect statistics on logs.

  2. Add a chart: Each dashboard consists of multiple charts. Each chart displays the results of one or more query statements.

  3. Configure a data conversion rule of the Connect type: You can use the rule to join two tables over a field that exists in both tables and perform a JOIN query operation.

Step 1: Query and analyze data

  1. Log on to the Simple Log Service console. In the Projects section, click the project you want.

  2. In the left-side navigation pane, click Log Storage. In the Logstores list, click the logstore you want.

    image

  3. Enter a query statement in the search box and click Last 15 Minutes to specify a query time range.

    Examples:

    • Query Statement A:

      * | select __time__,request_method,status limit 10000
    • Query Statement B:

      * | select __time__,request_url

Step 2: Add a table

  1. In the left-side navigation pane, choose Dashboard > Dashboards. In the dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, click Add > Add Chart.

    image

  2. On the General Configurations tab, click the Table Pro icon in the Chart Types section. On the Search & Analysis tab, select Logstore (SQL) and the logstore you want. Then enter the query statement. Select a time range, such as Last 15 Minutes, and click OK.

    image

Step 3: Configure a data conversion rule of the Connect type

On the Edit Chart page, click the Data Conversion tab. Click Add Conversion and select Connect from the drop-down list that appears. Then, set the Connection Mode parameter to Left Join and the Connection Field parameter to __time__ to join the results of Query Statement A and Query Statement B for query. After you complete the configuration, click Apply to view the results of the JOIN query operation.

image