Simple Log Service (SLS) lets you add Markdown charts to dashboards to display text, such as background information, chart descriptions, and page notes. This topic describes how to configure a Markdown chart using query and analysis results.
Prerequisites
-
You have collected data. For more information, see Collect text logs from a host.
-
You have created an index. For more information, see Create an index.
-
You have created a dashboard. For more information, see Create a dashboard quickly.
Overview

-
Query and analysis: Query your logs in the console to search, aggregate, and analyze data.
-
Configure a Markdown chart: Use the query and analysis results to configure a Markdown chart and add it to a dashboard.
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 navigation pane on the left, click Log Storage. In the Logstores list, click the target Logstore.

-
Enter the following query statements and click Search & Analyze to ensure the logs are queryable.
-
Count the total number of logs.
* | SELECT COUNT(*) as COUNT -
Find the status with the most requests and the corresponding request count.
* | SELECT status, COUNT(*) as c group by status order by c DESC limit 1 -
Find the error status code (status > 400) with the most requests and the corresponding request count.
* and status > 400 | SELECT status, COUNT(*) as c group by status order by c DESC limit 1
-
Step 2: Configure a Markdown chart
-
In the navigation pane on the left, choose . In the Dashboards list, click the target dashboard. In the upper-right corner, click Edit. In edit mode, click .

-
On the right side of the page, . In the main panel, configure the time range, Logstore, and query statement. Then, click Apply at the top of the page to view the chart.
Important-
For a single query, you can reference a field name directly. For example:
${{field_name}}. -
For multiple queries, prefix the field name with the query ID to prevent naming conflicts. For example:
${{query_ID.field_name}}. For more information about the query ID, see Limitations.
-
: Centers the chart content horizontally.
-
: Centers the chart content vertically.

-