You can configure a data conversion rule of the Transpose Rows and Columns type for a table on a dashboard to transform the table layout and optimize data analysis. This further facilitates data import and export.
Prerequisites
Data is collected. For more information, see Collect text logs from servers.
Indexes are created. For more information, see Create indexes.
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.
For example, you can enter the following query statement to query the paths to imported files and the number of imported files:
* | select split_part(request_uri,'?',1) as path, count(1) as count group by split_part(request_uri,'?',1) order by count desc limit 10
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 choose the logstore you want, and 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 Transpose Rows and Columns type
On the Edit Chart page, click the
tab. Click Add Conversion and select Transpose Rows and Columns from the drop-down list that appears. Then, set the Select Data Source parameter to A. This way, the rows and columns in the table that displays the results of Query Statement A are transposed.