CloudWatchLogs / Client / get_scheduled_query

get_scheduled_query

CloudWatchLogs.Client.get_scheduled_query(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.get_scheduled_query(
    identifier='string'
)
Parameters:

identifier (string) –

[REQUIRED]

The name or ARN of the scheduled query to retrieve.

Return type:

dict

Returns:

Response Syntax

{
    'scheduledQueryArn': 'string',
    'name': 'string',
    'description': 'string',
    'queryLanguage': 'CWLI'|'SQL'|'PPL',
    'queryString': 'string',
    'logGroupIdentifiers': [
        'string',
    ],
    'scheduleExpression': 'string',
    'timezone': 'string',
    'startTimeOffset': 123,
    'destinationConfiguration': {
        's3Configuration': {
            'destinationIdentifier': 'string',
            'roleArn': 'string'
        }
    },
    'state': 'ENABLED'|'DISABLED',
    'lastTriggeredTime': 123,
    'lastExecutionStatus': 'Running'|'InvalidQuery'|'Complete'|'Failed'|'Timeout',
    'scheduleStartTime': 123,
    'scheduleEndTime': 123,
    'executionRoleArn': 'string',
    'creationTime': 123,
    'lastUpdatedTime': 123
}

Response Structure

  • (dict) –

    • scheduledQueryArn (string) –

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

    • name (string) –

      The name of the scheduled query.

    • description (string) –

      The description of the scheduled query.

    • queryLanguage (string) –

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

    • queryString (string) –

      The CloudWatch Logs Insights query string being executed.

    • logGroupIdentifiers (list) –

      The log group identifiers being queried by the scheduled query.

      • (string) –

    • scheduleExpression (string) –

      The cron expression that defines when the scheduled query runs.

    • timezone (string) –

      The timezone in which the schedule expression is evaluated.

    • startTimeOffset (integer) –

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

    • destinationConfiguration (dict) –

      Configuration for destinations where the query results are delivered.

      • s3Configuration (dict) –

        Configuration for delivering query results to an Amazon S3 bucket.

        • destinationIdentifier (string) –

          The S3 URI where query results will be stored (e.g., s3://bucket-name/prefix/).

        • roleArn (string) –

          The ARN of the IAM role that CloudWatch Logs will assume to write results to the S3 bucket.

    • state (string) –

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

    • lastTriggeredTime (integer) –

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

    • lastExecutionStatus (string) –

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

    • scheduleStartTime (integer) –

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

    • scheduleEndTime (integer) –

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

    • executionRoleArn (string) –

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

    • creationTime (integer) –

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

    • lastUpdatedTime (integer) –

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

Exceptions

  • CloudWatchLogs.Client.exceptions.ValidationException

  • CloudWatchLogs.Client.exceptions.AccessDeniedException

  • CloudWatchLogs.Client.exceptions.ResourceNotFoundException

  • CloudWatchLogs.Client.exceptions.ThrottlingException

  • CloudWatchLogs.Client.exceptions.InternalServerException