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
Log data is collected. For more information, see Collect text logs from servers.
Indexes are created. For more information, see Create indexes.
Solution
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.
Add a chart: Each dashboard consists of multiple charts. Each chart displays the results of one or more query statements.
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
Log on to the Simple Log Service console. In the Projects section, click the project you want.
In the left-side navigation pane, click Log Storage. In the Logstores list, click the logstore you want.
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
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.
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.
Step 3: Configure a data conversion rule of the Connect type
On the Edit Chart page, click the
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.