All Products
Search
Document Center

Simple Log Service:Configure a Markdown chart with query results

Last Updated:Mar 25, 2026

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

Overview

image

  1. Query and analysis: Query your logs in the console to search, aggregate, and analyze data.

  2. 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

  1. Log on to the Simple Log Service console. In the Projects section, click the project you want.

    image

  2. In the navigation pane on the left, click Log Storage. In the Logstores list, click the target Logstore.

    image

  3. 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

  1. In the navigation pane on the left, choose Dashboard > Dashboards. In the Dashboards list, click the target dashboard. In the upper-right corner, click Edit. In edit mode, click Add > Add Chart.

    image

  2. On the right side of the page, General Configurations > Chart Types > image. 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.

    • General Configurations > Markdown Configurations > Center Method > Horizontally Center: Centers the chart content horizontally.

    • General Configurations > Markdown Configurations > Center Method > Vertically Center: Centers the chart content vertically.

    image