All Products
Search
Document Center

Simple Log Service:Configure multiple queries

Last Updated:Jun 17, 2026

A bar gauge supports multiple query and analysis statements, allowing you to display results from different queries as separate bars in a single chart and customize settings for each field.

Prerequisites

Overview

image

  1. Query and analyze: Retrieve, aggregate, and perform statistical analysis on logs in the console.

  2. Configure a bar gauge: Add three query and analysis statements, set a different color for each query result, and then add the bar gauge to the target dashboard.

Step 1: Query and analyze

  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.

  3. Enter the following query and analysis statements and click Search & Analyze to view the logs.

    • Calculate the UV

      status < 400 | SELECT approx_distinct(client_ip) AS UV
    • Count the PV

      status < 400 | SELECT count(*) AS PV
    • Count log entries

      * | SELECT count(*) AS count

Step 2: Configure a bar gauge

1. Add a bar gauge

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

2. Configure multiple queries

On the right side of the page, choose General Configurations > Chart Types > image. On the left side, configure the query time range, Logstore, and query and analysis statements. Then, click Apply at the top of the page to view the chart.

  • General Configurations > Search & Analysis Settings > A: Select the UV field from query A's results.

  • General Configurations > Search & Analysis Settings > B: Select the PV field from query B's results.

  • General Configurations > Search & Analysis Settings > C: Select the count field from query C's results.

Set the data source to website_log and the query time range to 15 Minutes. The statement for query A is status < 400 | SELECT approx_distinct(client_ip) AS UV, the statement for query B is status < 400 | SELECT count(*) AS PV, and the statement for query C is * | SELECT count(*) AS count.

3. Color settings

On the Field Configuration tab on the right side of the page, set the colors for the bar gauge. For more information about other settings, see field settings.

  • The settings under A apply to the results of query A. Set the color to green.

  • The settings under B apply to the results of query B. Set the color to blue.

  • The settings under C apply to the results of query C. Set the color to pink.