tencent cloud

피드백

SELECT Syntax

마지막 업데이트 시간:2024-01-20 17:25:15
    The SELECT statement is used to select data from a table. It selects eligible data from the current log topic by default.

    Syntax Format

    * | SELECT [Column name(KEY)]

    Syntax Example

    Select values with columns (KEY) being remote_addr and method from the log data:
    * | SELECT remote_addr, method
    Select all columns (KEY) from the log data:
    * | SELECT *
    SELECT can also be followed by arithmetic expressions; for example, you can query the download speed of log data:
    Download speed (speed) = total number of bytes sent (body_bytes_sent) / request time (request_time)
    * | SELECT body_bytes_sent / request_time AS speed

    Column Naming Conventions

    In SQL specifications, a column name consists of letters, digits, and underscores and starts with a letter, such as remote_addr. If a field in a log has a non-compliant name, you need to surround the name by "". You can also specify an alias for the field with AS syntax in SQL.
    If a log field is named remote_addr, which conforms to SQL's column naming conventions, it can be queried by SELECT:
    * | SELECT remote_addr
    If a log field is named __TAG__.pod_label_qcloud-app, which does not conform to SQL's column naming conventions, it needs to be surrounded by "":
    * | SELECT "__TAG__.pod_label_qcloud-app"
    If a log field is named __TIMESTAMP__, which does not conform to SQL's column naming conventions, it needs to be surrounded by "" and specified with an alias through the AS syntax:
    * | SELECT "__TIMESTAMP__" AS log_time
    문의하기

    고객의 업무에 전용 서비스를 제공해드립니다.

    기술 지원

    더 많은 도움이 필요하시면, 티켓을 통해 연락 바랍니다. 티켓 서비스는 연중무휴 24시간 제공됩니다.

    연중무휴 24시간 전화 지원