Skip to content

Create Index Configuration



POST /api/v1/log_index_cfg/add

Overview

Modify a single default storage index configuration

Body Request Parameters

Parameter Name Type Required Description
name string Y Index name
Example: xxx
Allow empty: False
Max length: 256
desc string Index description
Example: xxx
Allow empty: False
Allow empty string: True
Max length: 1024
extend json Frontend custom data
Allow empty: True
duration string Data retention duration
Allow empty: False
Example: 7d
directIndex boolean Native direct write index, default false, added in 2025-06-25 iteration
Allow empty: False
setting json Related configuration information
Allow empty: False
setting.hot_retention int Volcengine storage, standard storage - hot storage
Allow empty: False
setting.cold_retention int Volcengine storage, low-frequency storage - cold data
Allow empty: False
setting.archive_retention int Volcengine storage, archive storage - archive data
Allow empty: False

Parameter Additional Explanation

1. Request Parameter Explanation

Parameter Name Type Required Description
name String Required Index name
desc String Index description
extend Json Extension information for frontend display
duration Json Total storage duration of the index, example: 60d
directIndex Boolean Native direct write index, default false, added in 2025-06-25 iteration
setting Json Index configuration information when the log is stored in Volcengine

2. **setting Parameter Explanation

Parameter Name Type Required Description
hot_retention int Required Standard storage - hot data, must be a whole number of hours, unit: hours h
cold_retention int Low-frequency storage - cold data, must be a whole number of hours, unit: hours h
archive_retention int Archive storage - archive data, must be a whole number of hours, unit: hours h

2.1、Volcengine storage duration limits:
Standard storage: hot data storage, data range: 1-1800 days. If there is low-frequency storage, the data range is 7-1800 days; if there is archive storage, the data range is 30-1800 days.
Low-frequency storage: cold data storage, data range: 30-1800 days.
Archive storage: archive data storage, data range: 60-1800 days.
2.2、Volcengine storage duration limits:
Total storage duration (standard storage + low-frequency storage + archive storage) cannot exceed 1800 days.


3. **extend Parameter Explanation

Parameter Name Type Required Description
filters Array[dict] Filter condition list, native direct write index does not need to be configured
extendFields Array Index extension field information
extendFields[*].tag String Yes Key field name
extendFields[*].alias String Key field alias

4. extend.filters Main Structure Explanation

Parameter Name Type Required Description
condition string Relationship with the previous filter condition, optional values:and, or; default value: and
name string Field name to be filtered
operation string Operator, optional values: in, not_in
value array Value list
value[#] string/int/boolean Can be string/number/boolean type

Request Example

curl 'https://openapi.guance.com/api/v1/log_index_cfg/add' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: zh' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"name": "test_index", "duration":"14d","extend":{"filters":[{"condition":"and","name":"host","operation":"in","value":["custom_host1"]}]}}' \
--compressed

Response

{
    "code": 200,
    "content": {
        "conditions": "{  `host` in [ 'custom_host1' ] }",
        "createAt": 1698751853,
        "creator": "xxx",
        "deleteAt": -1,
        "duration": "14d",
        "extend": {
            "filters": [
                {
                    "condition": "and",
                    "name": "host",
                    "operation": "in",
                    "value": [
                        "custom_host1"
                    ]
                }
            ]
        },
        "exterStoreName": "",
        "exterStoreProject": "",
        "externalResourceAccessCfgUUID": "",
        "id": null,
        "isBindCustomStore": 0,
        "isPublicNetworkAccess": 0,
        "name": "test_index",
        "queryType": "logging",
        "region": "",
        "setting": {},
        "sortNo": 3,
        "status": 0,
        "storeType": "",
        "updateAt": 1698751853,
        "updator": "xxx",
        "uuid": "lgim_xxxx32",
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-600346C3-6C89-4391-9CA3-2152D10149D8"
} 

Feedback

Is this page helpful? ×