Skip to content

Send Query Task



POST /api/v1/logmine/send_task

Overview

Submit a text clustering task for asynchronous logs or other supported data domains in the current workspace.

Before Calling and Usage Steps

Use the Key of the target workspace; either routine.defaultAccess or anonymous.snapshotShared entry permission is required. Actual data queries are still restricted by data domain permissions, indexes, and Data Access rules; basic access permission does not mean you can query all data. This page provides the invocation contract according to the public Body declaration. Control parameters such as targetWorkspaceUUID/targetWorkspaceUUIDs/targetRegion/indexes/docLimit are not exposed in JSON, and it is not recommended to rely on undeclared additional parameters. For the submission API, there is historical compatibility for URL parameter retrieval: URL business fields may override JSON values with the same name or add undeclared fields, and not all additional URL parameters will be rejected; this does not constitute a stable extension contract. Clients should use only the JSON parameters on this page and must not mix in URL business parameters.

Submit an asynchronous clustering task without writing back to or modifying the original data. Before calling, verify the filter statement and actual fields, and choose as small a time range as possible; first submit and save the taskId, then use Get Query Task Result to poll in the same workspace. There is no need to repeatedly submit the same request consecutively; if a Cache write failure occurs after submission, a remote task may already have been created, and an API failure does not mean the remote side did not execute at all.

Each submission processes at most the number of documents configured by the site's LogmineSet.docLimit (code default 10000), which are sent to the service in descending time order; this API cannot change this upper limit. The returned processingLimit is the configured upper limit saved for this submission, not the number of documents already analyzed, and it cannot be used to prove coverage of the entire time window. When there are no queryable indexes, the sentinel taskId=no_index_list and processingLimit=null are returned, which does not mean a complete scan was actually executed. The context is cached for 20 minutes, so poll promptly and save the results. If the upstream lacks a taskId, the current service does not validate it again, and HTTP 200 may be returned with taskId being null or an empty value; this should be treated as an abnormal submission result, stop polling and recreating in a loop, and retain the traceId so administrators can check whether a remote task was created.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with the required permission for this operation from the API Key management of the target workspace.

Body Request Parameters

Parameter Type Required Description
query string Optional. When non-empty, it takes precedence as the complete statement, and conditions is no longer concatenated in; namespace still controls result masking/domain validation, and analysisField is still required. If the statement contains an explicit time window, each layer must be an absolute time expression fully consistent with timeRange; relative windows are not allowed to bypass this.
Allow null: False
Example: L::`*`:(`__docid`, `message`)
How to obtain or enter: Verify in the query tool a DQL statement that contains __docid and the fields listed in analysisField; if not provided, the system generates it.
namespace string If omitted, defaults to logging; an explicit empty string will first be rejected with 406 due to public enum validation, and the value must match the enum. Even if query is provided, it is still used for masking and lineage validation; you cannot declare logging while actually querying lineage.
Allow null: False
Optional values: ['lineage', 'object', 'object_history', 'custom_object', 'logging', 'keyevent', 'unrecovered_event', 'tracing', 'rum', 'network', 'security', 'backup_log', 'profiling', 'billing']
Example: logging
How to obtain or enter: Select the public enum based on the clustering data source; use logging for logs and lineage for Catalog.
highlight boolean Optional boolean. Highlight information is generated by the clustering query service; you cannot assume the response always contains highlight fields. When displaying, prevent treating data as executable HTML.
Example: false
How to obtain or enter: Choose based on whether the client can display highlighted text; default false.
conditions string Optional string, default empty; takes effect only when a non-empty query is not provided, and may be with or without outer curly braces.
Allow null: False
Allow empty string: True
Example: `source` IN ["nginx"]
How to obtain or enter: Select filter conditions from the actual collected Tags/fields; do not enter the entire query statement.
timeRange array Optional array; it is recommended to always submit two valid integer millisecond values. The public declaration does not restrict element type/length; the default is an empty array. Subsequent preprocessing or the query service is not guaranteed to accept it, and it cannot be understood as automatically querying all history.
Allow null: False
Example: [1785427200000, 1785429000000]
How to obtain or enter: Select a start and end time with data, in Unix milliseconds, with the start before the end.
analysisField string Y Required string; after splitting, remove whitespace on both sides of each item; the returned message is processed based on the values of these fields. For lineage, empty fields/duplicate fields/backticks or control characters are additionally prohibited. For other domains, deduplication is also recommended; do not rely on weaker historical validation.
Allow null: False
Example: message
How to obtain or enter: Select the text fields to analyze from the actual data schema, such as message; a maximum of 3 fields, separated by commas.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/logmine/send_task' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"namespace":"logging","analysisField":"message","conditions":"`source` IN [\"nginx\"]","highlight":false,"timeRange":[1785427200000,1785429000000]}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.taskId string or null Identifier for subsequent polling; no_index_list indicates a local sentinel for no queryable indexes. If the upstream lacks this key, null may be returned as-is; empty/null is not a pollable task.
content.processingLimit integer or null Maximum number of documents processed when created this time; null when there are no indexes, which is not equal to the total number of matched documents.
content.timeRange array Millisecond time range passed in at creation time, not a range automatically overridden by the server.
content.declaration object or null Workspace public declaration attached to a non-empty business object; it may be null or an empty object when not configured; an empty object is not added.
{
  "code": 200,
  "content": {
    "taskId": "logmine_task_example",
    "processingLimit": 10000,
    "timeRange": [
      1785427200000,
      1785429000000
    ],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

See Common Error Definitions for authentication, rate limiting, and common request errors.

The task service may have dynamic data query/permission errors; handle them according to the actual HTTP status and error body. A 5xx without a passthrough flag will be uniformly converted to HTTP 500 ft.InternalServerError; you cannot assume all upstream codes are exposed as-is. HTTP 200 with success=true only indicates that this submission/polling API call succeeded, not that asynchronous clustering has completed.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed A request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError The request JSON syntax is invalid Request JSON format error Correct the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The POST body is not a JSON object Some JSON file format error Submit the object corresponding to the parameter table.
406 ft.InvalidParameter namespace/analysisField is invalid, the window pre-validation parser for a non-empty query reports ParserError, the window is inconsistent with timeRange, or the lineage statement mixes domains/is nested and is not supported Parameter {} is invalid Check the explicit data domain, 1 to 3 fields, and a two-element millisecond time range, and use a pure lineage query or the corresponding real domain.
400 ft.LogmineCountExceedsLimit analysisField is split by comma into more than 3 items Number of clustering fields exceeds the limit; a maximum of 3 is supported Submit only 1 to 3 fields that need clustering; do not use a trailing comma.
406 ft.DqlParseError DQL parsing or query preprocessing failed dql parser parsing failed: {} First verify the DQL syntax and actual data domain, then correct the statement.
500 ft.InternalServerError The task query service 5xx without passthrough is uniformly wrapped; Cache/Database errors, or the upstream structure cannot be parsed Internal error Retain the traceId; when the result of an already submitted request is unknown, do not immediately create it repeatedly in a loop. First check the task status, or retry later with a smaller range.
403 ft.ForbiddenQuery The Key does not have query authorization for the data domain required by the statement You do not have {} permission Configure the corresponding data domain query permission for the current Key, and check Data Access and index restrictions.

Feedback

Is this page helpful?