跳转至

获取日志 Schema 信息



GET /api/v1/metric_info/log/schema

概述

根据日志索引名获取其 Schema 信息(日志专用接口,字段结构与时序数据一致,每个 field 包含各自的 tags 信息)

Query 请求参数

参数名 类型 必选 说明
index string 日志索引名称,不传时默认使用 default
允许为空: True

参数补充说明

通过 SHOW_LOGGING_FIELD(index='索引名') 函数获取日志索引的 schema 信息。

  • 未指定 index 时,默认使用 default
  • 指定其他索引时,index 使用传入的日志索引名

请求例子

curl -k 'https://openapi.guance.com/api/v1/metric_info/log/schema?index=dbindex' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--compressed

响应

{
    "code": 200,
    "content": {
        "declaration": {
            "business": "",
            "organization": "663dbba102482200070bbb02"
        },
        "fields": [
            {
                "description": "",
                "name": "__truncated_id",
                "type": "text",
                "value_type": "keyword"
            },
            {
                "description": "",
                "name": "container_name",
                "type": "text",
                "value_type": "keyword"
            },
            {
                "description": "",
                "name": "create_time",
                "type": "text",
                "value_type": "long"
            },
            {
                "description": "",
                "name": "image",
                "type": "text",
                "value_type": "keyword"
            },
            {
                "description": "",
                "name": "index",
                "type": "text",
                "value_type": "keyword"
            }
        ],
        "index": "dbindex"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "69ba6c7800000000f308c58b1256a04b"
} 

文档评价

文档内容是否对您有帮助? ×