This topic describes how to configure common features for a table. The features include search and filter, variable replacement, and multi-statement query.
Prerequisites
Log data is collected. For more information, see Collect text logs from servers.
Indexes are created. For more information, see Create indexes.
Overview
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 common features: You can configure the search and filter, variable replacement, and multi-statement query for a table.
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.
Example:
Query Statement A:
${{date| 60}}
specifies a variable. For more information, see Use variables to dynamically modify the parameters of a query statement.* | select __time__ - __time__ % ${{date| 60}} as time,request_method
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 common features for a table
Search and filter
Search
: The search feature supports all fields in a table.
Click the
icon to the right of a column name and enter a keyword for searching.
Filter
: The filter feature supports all fields in a table.
Click the
icon to the right of a column name and click theicon. You can select multiple options for filtering.
Variable replacement
date
variable in Query Statement A is replaced with min
.
After you configure the settings, a filter appears in the upper-left corner of the chart. If you select a value from the filter drop-down list, Simple Log Service performs a query and analysis operation based on the value that you select. The following query statement is executed: * | select __time__ - __time__ % 100 as time,request_method
.
Multi-statement query
* | select *
query statement, and then click Apply. Then, select Query Statement B to view the query results.