Skip to main content

trace_queries

Creates, updates, deletes, gets or lists a trace_queries resource.

Overview​

Nametrace_queries
TypeResource
Idsumologic.tracing.trace_queries

Fields​

The following fields are returned by SELECT queries:

Status of the given trace search query.

NameDatatypeDescription
query_rowsarrayA list of trace queries. (wire: queryRows)
statusstringStatus of the query. Possible values: Processing, Finished, Error, Canceled. (pattern: <code>^(Processing|Finished|Error|Canceled)$</code>, example: Processing, x-pattern-message: Should be either Processing, Finished, Error, Canceled.)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectquery_id, regionGet a status of a trace query with the given id. When the query has been completed, use the Trace Query Result endpoint to get the result of the asynchronous query.
createinsertregion, query_rows, time_rangeExecute a trace search query and get the id to fetch its status and results. Use the Trace Query Status endpoint to check a query status. When the query has been completed, use the Trace Query Result endpoint to get the result of the asynchronous query.
deletedeletequery_id, regionCancel a currently processed trace search query with the given id.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
query_idstringIdentifier of the query to cancel. (wire: queryId)
regionstringSumo Logic deployment (au, ca, ch, de, eu, fed, in, jp, kr, us1, us2). Resolved from the SUMOLOGIC_ENVIRONMENT environment variable when it is set (x-stackQL-envVar, the same variable the Terraform provider reads); otherwise defaults to us2. A WHERE region = '...' value always takes precedence. (enum: [au, ca, ch, de, eu, fed, in, jp, kr, us1, us2], default: us2, x-stackQL-envVar: SUMOLOGIC_ENVIRONMENT)

SELECT examples​

Get a status of a trace query with the given id. When the query has been completed, use the Trace Query Result endpoint to get the result of the asynchronous query.

SELECT
query_rows,
status
FROM sumologic.tracing.trace_queries
WHERE query_id = '{{ query_id }}' -- required
AND region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
;

INSERT examples​

Execute a trace search query and get the id to fetch its status and results. Use the Trace Query Status endpoint to check a query status. When the query has been completed, use the Trace Query Result endpoint to get the result of the asynchronous query.

INSERT INTO sumologic.tracing.trace_queries (
query_rows,
time_range,
region
)
SELECT
'{{ query_rows }}' /* required */,
'{{ time_range }}' /* required */,
'{{ region }}'
RETURNING
query_id
;

DELETE examples​

Cancel a currently processed trace search query with the given id.

DELETE FROM sumologic.tracing.trace_queries
WHERE query_id = '{{ query_id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;