GetScheduledQuery - Amazon CloudWatch Logs

GetScheduledQuery

Returns detailed information about a specified scheduled query, including its configuration, current state, and execution history.

Request Syntax

{ "identifier": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

identifier

The name or ARN of the scheduled query to retrieve.

Type: String

Pattern: [\w#+=/:,.@-]*

Required: Yes

Response Syntax

{ "creationTime": number, "description": "string", "destinationConfiguration": { "s3Configuration": { "destinationIdentifier": "string", "roleArn": "string" } }, "executionRoleArn": "string", "lastExecutionStatus": "string", "lastTriggeredTime": number, "lastUpdatedTime": number, "logGroupIdentifiers": [ "string" ], "name": "string", "queryLanguage": "string", "queryString": "string", "scheduledQueryArn": "string", "scheduleEndTime": number, "scheduleExpression": "string", "scheduleStartTime": number, "startTimeOffset": number, "state": "string", "timezone": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

creationTime

The time when the scheduled query was created, in Unix epoch time.

Type: Long

Valid Range: Minimum value of 0.

description

The description of the scheduled query.

Type: String

Length Constraints: Maximum length of 1024.

destinationConfiguration

Configuration for destinations where the query results are delivered.

Type: DestinationConfiguration object

executionRoleArn

The ARN of the IAM role used to execute the scheduled query.

Type: String

Length Constraints: Minimum length of 1.

lastExecutionStatus

The status of the last executed query (Running, Complete, Failed, Timeout, or InvalidQuery).

Type: String

Valid Values: Running | InvalidQuery | Complete | Failed | Timeout

lastTriggeredTime

The time when the scheduled query was last executed, in Unix epoch time.

Type: Long

Valid Range: Minimum value of 0.

lastUpdatedTime

The time when the scheduled query was last updated, in Unix epoch time.

Type: Long

Valid Range: Minimum value of 0.

logGroupIdentifiers

The log group identifiers being queried by the scheduled query.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 50 items.

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

Pattern: [\w#+=/:,.@-]*

name

The name of the scheduled query.

Type: String

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

Pattern: ^[a-zA-Z0-9_\-/.#]+$

queryLanguage

The query language used by the scheduled query (LogsQL, PPL, or SQL).

Type: String

Valid Values: CWLI | SQL | PPL

queryString

The CloudWatch Logs Insights query string being executed.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 10000.

scheduledQueryArn

The Amazon Resource Name (ARN) of the scheduled query.

Type: String

scheduleEndTime

The end time for the query schedule in Unix epoch time.

Type: Long

Valid Range: Minimum value of 0.

scheduleExpression

The cron expression that defines when the scheduled query runs.

Type: String

Length Constraints: Maximum length of 256.

scheduleStartTime

The start time for the query schedule in Unix epoch time.

Type: Long

Valid Range: Minimum value of 0.

startTimeOffset

Time offset in seconds from the execution time for the start of the query time range.

Type: Long

state

The current state of the scheduled query (ENABLED or DISABLED).

Type: String

Valid Values: ENABLED | DISABLED

timezone

The timezone in which the schedule expression is evaluated.

Type: String

Length Constraints: Minimum length of 1.

Errors

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

AccessDeniedException

You don't have sufficient permissions to perform this action.

HTTP Status Code: 400

InternalServerException

An internal server error occurred while processing the request. This is typically a temporary issue and the request can be retried.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 400

ThrottlingException

The request was throttled because of quota limits.

HTTP Status Code: 400

ValidationException

One of the parameters for the request is not valid.

HTTP Status Code: 400

See Also

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