Skip to content

Create Data Query Task



POST /api/v1/log_backup_cfg/query_task

Overview

Create an asynchronous query task for data forwarding, returns the query task ID. The query task ID can be used later to check the task status. Note: A single query can retrieve a maximum of 10 files. To query more files, please call again with the token parameter, where the token parameter value is 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, only supports regular expressions
Allow empty: False
startTime string Y Start time, precise to millisecond-level timestamp (string)
Example: 1763542157000
Allow empty: False
endTime string Y End time, precise to millisecond-level timestamp (string)
Example: 1763542157000
Allow empty: False
token string Query cursor, if paging queries are needed, carry the token from the previous request result
Allow empty: False
Allow empty string: True
topN integer Number of returns per page
Allow empty: False
Example: 10
$minValue: 1
$maxValue: 1000
dataType string Data type
Allow empty: False
Optional values: ['logging', 'tracing', 'rum', 'keyevent', 'audit_event']

Parameter Additional Explanation

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, optional values: and, or

conditions Parameter Description

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

Request Example

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? ×