Get Log Schema Information¶
GET /api/v1/metric_info/log/schema
Overview¶
Retrieve the schema information based on the log index name (a dedicated interface for logs. The field structure is consistent with time series data, and each field contains its own tags information).
Query Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| index | string | The name of the log index. Uses default if not provided.Allow empty: True |
Parameter Supplementary Notes¶
Use the SHOW_LOGGING_FIELD(index='index_name') function to obtain the schema information of a log index.
- When
indexis not specified,defaultis used. - When specifying other indexes,
indexuses the provided log index name.
Request Example¶
curl -k 'https://openapi.truewatch.com/api/v1/metric_info/log/schema?index=dbindex' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--compressed
Response¶
{
"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"
}