Skip to content

Export



POST /api/v1/log_index_cfg/export

Overview

Export log index templates based on the filter conditions from the log index list.

Query Request Parameters

Parameter Name Type Required Description
search string Search by index name
Allow empty string: True
isBindCustomStore boolean Whether bound to custom storage. Only internal indexes are supported for export. Result will be empty if true is passed.
isDirectIndex boolean Whether it is a native direct-write index
queryType commaArray Storage query type

Parameter Supplementary Description

This API is used to export log index templates individually, without going through the workspace resource export task.

Request Instructions

  1. The export parameters are consistent with the log index list interface, but pagination and cross-workspace related parameters are not supported.
  2. Currently supported filter parameters are search, queryType, isDirectIndex, isBindCustomStore.
  3. Only internal log indexes under the current workspace are exported.
  4. The default index and external indexes will not be exported.
  5. The returned result is a JSON list, which can be directly used as the input template for /log_index_cfg/import.

Export Fields

Field type Description
name string Index name
desc string Index description
directIndex boolean Whether it is a native direct-write index
conditions string Index matching conditions
duration string Storage retention period
extend json Extended configuration
setting json Storage settings
fields array Field mapping configuration
is_disable boolean Whether disabled

Request Example

curl 'https://openapi.truewatch.com/api/v1/log_index_cfg/export?search=app-log&isDirectIndex=false' \
-H 'DF-API-KEY: <DF-API-KEY>'

Response

{
    "code": 200,
    "content": [
        {
            "name": "app-log",
            "desc": "Application log index",
            "directIndex": false,
            "conditions": "",
            "duration": "7d",
            "extend": {},
            "setting": {},
            "fields": [
                {
                    "field": "service",
                    "originalField": "service"
                }
            ],
            "is_disable": false
        }
    ],
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-EXAMPLE"
}