Skip to content

Create a Data Query Task



POST /api/v1/log_backup_cfg/query_task

Overview

Create an asynchronous query task for data forwarding. The query task ID is returned and can be used later to check the task status.
Note: A single query can retrieve up to 10 files. To query more files, call the API again with the token parameter, which should be the token value returned from the previous query.

Body Request Parameters

Parameter Name Type Required Description
name string Y Rule name
Allow empty: False
search json Search, supports regex only
Allow empty: False
startTime string Y Start time, precise to millisecond timestamp (string)
Example: 1763542157000
Allow empty: False
endTime string Y End time, precise to millisecond timestamp (string)
Example: 1763542157000
Allow empty: False
token string Query cursor; to paginate, include the token from the previous response
Allow empty: False
Allow empty string: True
topN integer Number of results per page
Allow empty: False
Example: 10
$minValue: 1
$maxValue: 1000
dataType string Data type
Allow empty: False
Allow empty string: True
Valid values: ['llm', 'logging', 'tracing', 'rum', 'keyevent', 'audit_event', 'am']

Supplementary Parameter Description

search Request Parameter Description

Parameter Name type Description
conditions array[json] Query conditions, each condition is a JSON object containing fields: key, value, logic
operator string Logical operator, valid values: and, or

conditions Parameter Description

Parameter Name type Description
key string Field name
value string Field value
logic string Logical operator, valid values: match, notMatch

Example Request

curl 'https://openapi.guance.com/api/v1/log_backup_cfg/query_task' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"name":"xxx-test","dataType":"logging","startTime":"1764000000000","endTime":"1764037304000","search":"","topN":50}' \
--compressed

Response

{
    "code": 200,
    "content": {
        "task_id": "d4ih5flt3l333a0ulmu0:a29kby14LWJhY2t1cGxvZy0w"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "087552ec57015df654c5eaefdd604305"
} 

Feedback

Is this page helpful?