Skip to content

Create Data Query Task



POST /api/v1/log_backup_cfg/query_task

Overview

Create an asynchronous data forwarding query task, returning the query task ID. The query task ID can be used later to query 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, where the token parameter value is the token 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. To paginate queries, include the token from the previous request result.
Allow empty: False
Allow empty string: True
topN integer Number of items returned per page
Allow empty: False
Example: 10
$minValue: 1
$maxValue: 1000
dataType string Data type
Allow empty: False
Allowed values: ['llm', 'logging', 'tracing', 'rum', 'keyevent', 'audit_event']

Parameter Supplementary Description

search Request Parameter Description

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

conditions Parameter Description

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

Request Example

curl 'https://openapi.truewatch.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"
}