Log query

更新时间:
复制 MD 格式

This topic explains how to query and analyze Simple Log Service (SLS) logs in Managed Service for OpenTelemetry.

Prerequisites

  • Your application data is reported to Managed Service for OpenTelemetry. For more information, see Integrate services or components.

  • Your SLS logs are linked to Managed Service for OpenTelemetry. For more information, see Log association.

Procedure

  1. Log on to the Managed Service for OpenTelemetry console.

  2. In the left-side navigation pane, choose Advanced Query > Log Query. In the top menu bar, select your region.

  3. Select a Project and Type. Then, from the Logstore/StoreView drop-down list, select a Logstore or StoreView. The page displays only the Projects and Logstores in the current region. The SLS query and analysis interface then appears.

    1. In the search box, enter a query and analysis statement. A query and analysis statement consists of a query and an analysis, separated by a vertical bar (|), in the format query statement|analysis statement. For more information about the syntax, see Query syntax and functions and Aggregate functions.

    2. Set a time range for the query. You can select a relative, hourly, or custom time range.

      Note

      Query results may include logs generated up to one minute before or after the specified time range.

    3. Click Search & Analyze to view the results.

    Results are organized into three tabs: Raw Log, Statistical Chart, and Log Clustering. The Display Fields panel on the left lists all indexed fields. The area on the right shows the details for each log entry, such as body_bytes_sent, host, http_user_agent, and request_length.