All Products
Search
Document Center

Simple Log Service:Query Scheduled SQL results

Last Updated:Jun 16, 2026

Query the results of a Scheduled SQL job in a destination Logstore or Metricstore.

Prerequisites

You have created a Scheduled SQL job.

Query results in a destination Logstore

After a Scheduled SQL job saves its results to a Logstore, you can query them by using the job name.

  1. Log on to the Simple Log Service console.

  2. Obtain the Scheduled SQL job name.

    1. In the Projects section, click the project you want.

    2. In the left-side navigation pane, choose Job Management > Scheduled SQL. On the Scheduled SQL page, click the target job.

    3. In the Basic Information section, obtain the Scheduled SQL job name.

  3. Query the results of the Scheduled SQL job.

    1. Navigate to the destination Logstore. For more information, see Quick start for search and analysis.

    2. In the search box, enter __tag__:__job__: job-name.

      Replace job-name with the Scheduled SQL job name obtained in Step 2.

    3. Click 15 Minutes (Relative) to set a time range.

      Note

      If no data is returned, you can expand the time range.

    4. Click Search & Analyze.

      For example, the query __tag__:__job__: sql-1679626854-438974 returns six log entries. Each log entry includes tags such as __tag__:__job__, __tag__:__schedule_time__, and __tag__:__trigger_time__, along with the execution result, such as _col0:41.

Query results in a destination Metricstore

After a Scheduled SQL job saves its results to a Metricstore, you can query them by using the specified metrics.

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the one you want.

    image

  3. On the Metric Storage > Metricstores tab, click the metricstore you want.image

  4. Click 15 Minutes (Relative) to set a time range.

    Note

    If no data is returned, you can expand the time range.

  5. Enter a query statement for the target metrics, and then click Execute Now.

    Use the metric you specified in the Scheduled SQL job.

    On the Metrics Exploration page, select Metricstore (PromQL) as the data source, enter the query statement * | select promql_query_range('cpu_count{}') from metrics limit 1000, and then click Execute Now to view the query results for the metric.