SLS to DQL¶
POST /api/v1/sls/convert
Overview¶
Converts an Alibaba Cloud SLS query statement to a Guance DQL, without querying data in the workspace.
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| query | string | Y | Alibaba Cloud SLS query statement Allow empty: False Allow empty string: False |
| indexes | array | Optional, list of log index names; if not provided or an empty array is passed, no index restriction is applied. Allow empty: False |
Additional Parameter Notes¶
The returned status indicates the equivalence level of the conversion:
exact: The generated DQL is equivalent to the original SLS query;approximate: An approximate DQL has been generated; the caller should review the differences usingdiagnosticsbefore execution;unsupported: The current SLS syntax is not supported;dqlmay be empty.
Studio always uses the log namespace L. indexes is optional; if not provided or an empty array is passed, no index restriction is applied.
Example Request¶
curl 'https://openapi.truewatch.com/api/v1/sls/convert' \\
-H 'Content-Type: application/json' \\
-H 'DF-API-KEY: <DF-API-KEY>' \\
--data-raw '{"query":"status:200","indexes":["default"]}'