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 Additional Notes

This interface is used to export log index templates individually and does not require going through the workspace resource export task.

Request Notes

  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.

Exported Fields

Field type Description
name string Index name
desc string Index description
directIndex boolean Whether it is a native direct-write index
isFullLineIndex int Whether it is a full-line index. 0 means retaining the message field index, 1 means full-line index; can only be set to 1 for workspaces with log storage as scopedb.
conditions string Index matching conditions
duration string Storage duration
storagePolicy json Long-term storage policy
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,
            "isFullLineIndex": ,
            "conditions": "",
            "duration": "7d",
            "storagePolicy": {},
            "extend": {},
            "setting": {},
            "fields": [
                {
                    "field": "service",
                    "originalField": "service"
                }
            ],
            "is_disable": false
        }
    ],
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-EXAMPLE"
}