Transpose table rows and columns
Transpose table rows and columns on a dashboard to reformat data for easier import, export, and analysis.
Prerequisites
-
Data is collected. Collect text logs from servers.
-
An index is created. Create an index.
Overview
The following steps show how to transpose table rows and columns on a dashboard chart:
-
Query and analyze data: Search, aggregate, and compute statistics on log data in the console.
-
Add a chart: Add a chart to the dashboard. Each chart is driven by one or more query statements.
-
Transpose rows and columns: Swap the rows and columns of the query result.
Step 1: Query and analyze data
Log on to the Simple Log Service console. In the Projects section, click the project you want.

On the tab, click the logstore you want.

-
Enter a query statement, then click Last 15 Minutes to specify the time range.
Example: query the top 10 request paths by count:
* | 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 chart
In the left-side navigation pane, choose . In the Dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, choose .

-
In the section, select the
icon for Chart Type. On the Query and Analysis tab, select your data source (in this case, LogStore (SQL)), choose the target Logstore, and enter a query statement.In the upper-right corner, select a time range, such as Last 15 Minutes, from the drop-down list and click Apply.
Set Chart Type to Table. An example query statement is
* | select *.
Step 3: Transpose rows and columns
: Transpose the rows and columns for query A.
On the chart editing page, click the Data Conversion tab, set Type to Transpose Rows and Columns, and select A from the data source drop-down list.