This topic explains how to configure the search, filter, variable replacement, and multi-statement query features for a table chart.
Prerequisites
Log data is collected. For more information, see Collect text logs from hosts.
Indexes are created. For more information, see Create an index.
Overview

-
Query and analysis: Use the console to query and analyze logs. For example, you can retrieve logs, aggregate data, and view statistics.
-
Add a chart: A dashboard consists of one or more charts, and each chart uses one or more query statements.
-
Configure common features for a table chart: Set up search, filter, variable replacement, and multi-statement query features for your table chart.
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 and click Last 15 Minutes to set the time range.
Example:
-
For Query A, use the following query statement:
${{date| 60}}represents 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 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 .

Under , set Chart Type to
. On the Query and Analysis tab, select LogStore (SQL) and the destination Logstore, and then enter a query statement. In this example, LogStore is used.In the upper-right corner of the page, select a time range, such as Last 15 Minutes, from the drop-down list and click Apply.

Step 3: Configure common table features
Search and filter
-
Search
-
Choose . The search feature supports all fields in the chart.
-
Click the
icon to the right of a column name, and enter the content that you want to search for.
-
-
Filter
-
Choose . The filter feature supports all fields in the chart.
-
Click the icons to the right of a column name. The filter feature supports multiple selections.

-
Variable replacement
Go to . Set Variable Key to date and Display Name to time. Add a Variable Value List. In the list, set Display Name to min and Replacement Value to 100. This action replaces the date variable in Query and Analysis A with min.

After you complete the configuration, a filter appears in the upper-left corner of the chart. When you select a value, Simple Log Service runs a query based on your selection. The corresponding query statement is * | select __time__ - __time__ % 100 as time,request_method.

Multi-statement query
: Select the LogStore that you want to query (request_path), enter the query statement * | select *, and click Apply. Then, select Query and Analysis B to view the results of the current query and analysis.

> 