All Products
Search
Document Center

Simple Log Service:Query the result data of a Scheduled SQL job

Last Updated:Jun 06, 2024

This topic describes how to query the result data of a Scheduled SQL job in a Logstore or a Metricstore.

Prerequisites

A Scheduled SQL job is created.

Query the result data of the Scheduled SQL job in a Logstore

After you store the result data of the Scheduled SQL job to a Logstore, you can query the result data in the Logstore by using the name of the Scheduled SQL job.

  1. Log on to the Simple Log Service console.

  2. Obtain the name of the Scheduled SQL job.

    1. In the Projects section, click the project that you want to manage.

    2. In the left-side navigation pane, choose Job Management > Scheduled SQL. In the Scheduled SQL list, click the job whose name you want to obtain.

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

      查询Scheduled SQL结果数据

  3. Query the result data of the Scheduled SQL job.

    1. Find and access the Logstore that is used to store the result data of the Scheduled SQL job. For more information, see Query and analyze logs.

    2. Enter __tag__:__job__: job-name in the search box.

      The job-name field specifies the name of the Scheduled SQL job. Replace job-name with the name that you obtained in Step 2.

    3. Click 15 Minutes (Relative) and specify a query time range.

      Note

      If no data is returned, you can specify a longer query time range.

    4. Click Search & Analyze.

      查询Scheduled SQL结果数据

Query the result data of the Scheduled SQL job in a Metricstore

After you store the result data of the Scheduled SQL job to a Metricstore, you can query the result data in the Metricstore by using the metrics that you specify.

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the project that you want to manage.

    image

  3. On the Metric Storage > Metricstores tab, click the Metricstore that you want to manage.

  4. Click 15 Minutes (Relative) and specify a query time range.

    Note

    If no data is returned, you can specify a longer query time range.

  5. Enter a query statement based on the metric that you specify and click Execute Now.

    Use the metric that you specify when you create the Scheduled SQL job.

    查询Scheduled SQL结果数据