StartTelemetryQuery - Amazon CloudWatch Omni
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

StartTelemetryQuery

Starts a telemetry query within a session.

Submits the provided query string for execution in the specified session. Use GetTelemetryQueryResults to poll for results and check query status.

Request Parameters

queryString

The query string to execute.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64000.

Required: Yes

sessionId

The unique ID of the session.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-z0-9-]+

Required: Yes

Response Elements

The following elements are returned by the service.

queryId

The unique ID of the query.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-z0-9-]+

sessionId

The unique ID of the session.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-z0-9-]+

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

The caller is not authorized to perform this action.

HTTP Status Code: 403

InternalServerException

An unexpected error occurred while processing the request.

errorCode

The error code associated with the internal error.

HTTP Status Code: 500

ThrottlingException

The request was throttled due to exceeding the allowed request rate.

retryAfterSeconds

The number of seconds to wait before retrying the request. Not always present.

HTTP Status Code: 429

ValidationException

A parameter is specified incorrectly.

errorCode

The error code associated with the validation failure.

HTTP Status Code: 400

Examples

Start a telemetry query

The following example submits a SQL query within a session and returns the query ID used to poll for results. Payloads are shown as JSON; on the wire they are CBOR-encoded.

Sample Request

{ "queryString": "SELECT `@timestamp`, `@message` FROM "logs.default" WHERE `@timestamp` BETWEEN NOW() - INTERVAL '1 HOUR' AND NOW() ORDER BY `@timestamp` DESC LIMIT 100", "sessionId": "9f8c7d6e-5b4a-4c3d-9e2f-1a0b2c3d4e5f" }

Sample Response

{ "queryId": "3b2a1c0d-7e6f-4a5b-8c9d-0e1f2a3b4c5d", "sessionId": "9f8c7d6e-5b4a-4c3d-9e2f-1a0b2c3d4e5f" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: