Simple Log Service allows you to add Markdown charts to dashboards. You can use these charts to insert text content, such as background information, chart descriptions, page notes, and supplementary information, to enrich your dashboards. This topic describes how to configure a Markdown chart using query and analysis results.
Prerequisites
-
Data is collected. For more information, see Collect text logs from a host.
-
An index is created. For more information, see Create an index.
-
A dashboard is created. For more information, see Create a dashboard quickly.
Overview
After you complete the configuration, the Markdown chart displays the results of three queries. Query A shows the total number of log entries, for example, 7,532. Query B shows the status code with the highest request count, for example, status 200 with 6,524 requests. Query C shows the error status code with the highest request count, for example, status 401 with 34 requests.
-
Query and analyze data: Run queries in the console to perform log search, log aggregation, and log statistics.
-
Configure a Markdown chart: Use the query and analysis results to create 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 and analysis statements and click Search & Analyze to verify that the queries work as expected.
-
Count the total number of log entries.
* | SELECT COUNT(*) as COUNT -
Find the most frequent status code and its count.
* | SELECT status, COUNT(*) as c group by status order by c DESC limit 1 -
Find the most frequent error status code and its count.
* and status > 400 | SELECT status, COUNT(*) as c group by status order by c DESC limit 1
-
Step 2: Configure the Markdown chart
-
In the navigation pane on the left, choose . In the Dashboard list, click the target dashboard. In the upper-right corner of the dashboard, click Edit. In edit mode, click .
-
On the panel on the right, select . On the left side of the page, configure the time range, Logstore, and query and analysis statements. Then, click Apply at the top of the page to preview the chart.
Important-
If you have only one query, you can reference a field name directly, for example,
${{field name}}. -
When using multiple queries, you must prefix each field name with its corresponding query ID to prevent conflicts. For example,
${{query ID.field name}}. For more information about query IDs, see Limitations.
-
: Centers the chart content horizontally.
-
: Centers the chart content vertically.
In this example, three queries are configured on the website_log Logstore: Query A is
* | SELECT COUNT(*) as COUNT, Query B is* | SELECT status, COUNT(*) as c group by status order by c DESC limit 1, and Query C is* and status > 400 | SELECT status, COUNT(*) as c group by status order by c DESC limit 1. In the Markdown editor, use variables such as${{ COUNT }},${{ B.status }},${{ B.c }},${{ C.status }}, and${{ C.c }}to reference the result fields from each query. After rendering, the chart displays the corresponding statistical values. -