The table is the most common data display form and the most basic data sorting method for quick reference and analysis. Log Service provides a feature similar to SQL aggregate computing. It allows you to use query and analysis statements to obtain results and display the data results in a table.
- Table header
- You can use a
SELECTclause to specify the number of columns.
- The number of rows is computed based on the number of logs in the current time interval.
The default clause is
- On the search page of a Logstore, enter a query and analysis statement in the search box, set the time range, and then click Search & Analysis.
- On the Graph tab that appears, view the data that is automatically displayed in a table. You do not need to click .
- On the right-side Properties tab, configure the properties of the table.
|Items per Page||The number of entries to return on each page.|
|Zebra Striping||Specifies whether to obtain a zebra-striped table.|
|Transpose Rows and Columns||Click it to transpose rows and columns.|
|Hide Reserved Fields||Specifies whether to hide reserved fields.|
|Disable Sorting||Specifies whether to disable the sorting feature.|
|Disable Search||Specifies whether to disable the search feature.|
|Highlight Settings||The highlight rules for highlighting rows or columns that conform to rules.|
You can filter data in raw logs. The following figure shows a raw log.
- To filter the
request_timefields in the latest 10 logs, run the following statement:
* | SELECT method, request_size, request_timetus GROUP BY method, request_size, request_time LIMIT 10
- To compute the data of a field, for example, the average value of
request_size(the average request time) in the current time interval, and obtain the result that is accurate to three decimal places, run the following statement:
* | SELECT round(avg(request_size), 3) as average_request
- To compute grouped data, for example, the distribution of
client_ipin the current time interval and sort the data in descending order, run the following statement:
* | SELECT client_ip, count(*) as count GROUP BY client_ip ORDER BY count DESC