Simple Log Service displays query and analysis results in charts.
Limits
-
Only charts (Pro) support multiple query statements. For more information about supported charts (Pro), see Chart types.
-
Each query statement has a unique ID that is represented by an uppercase letter. Examples: A and B.
Basic configuration
To add a chart, run query statements on the Search & Analysis tab. After you add the query statements, click Apply to display the results in the Create Chart section in real time.
Each query statement, such as A or B, can use a different data source type, such as Logstore (SQL) or Metricstore (PromQL). Simple Log Service automatically joins and displays results from multiple queries in the chart area.
Query and analysis syntax
Run different query statements in a Logstore or Metricstore.
Logstore (SQL)
Run a query statement that uses SQL syntax in the target Logstore. For more information, see Log analysis overview.
For example, in the sls-mall-traces Logstore, enter the following query statement, which counts traces by kind in 60-second time windows: * | SELECT __time__ - __time__ % 60 AS Time, count(1) AS count , kind GROUP BY Time, kind ORDER BY Time LIMIT 1000.
Metricstore (PromQL)
Execute a query statement that follows the PromQL syntax in a Metricstore. For more information, see Overview of query and analysis on metric data.
Select Metricstore (PromQL) as the data source type and k8s-metrics as the target store. Enter the PromQL query statement (sum(rate(apiserver_audit_event_total[1m]))) by (namespace)). Then, set legend format to {{namespace}}, limit to 1000, and interval to auto.
Metricstore (SQL)
Execute a query statement that follows the SQL syntax in a Metricstore. For more information, see Overview of query and analysis on metric data.
For example, select sls-mall-metrics as the Metricstore and enter the following query statement: *|select __value__, __time_nano__ / 1000000 as time from "sls-mall-metrics.prom" where __name__ = 'runtime_jvm_gc_collection' ${{test||metricsql|and}}.
Builtin
Simple Log Service provides built-in templates for displaying query and analysis results in different scenarios.

What to do next
|
Operation |
Description |
|
Remove a query statement |
Click the |
|
Copy a query statement |
Click the |
|
Adjust the order of query statements |
Drag query statements to adjust their order. |
icon to remove a query statement.
icon to copy a query statement. You can then process multiple similar query statements at a time or make small changes.