CloudWatchLogs / Client / get_scheduled_query

get_scheduled_query

CloudWatchLogs.Client.get_scheduled_query(**kwargs)

Retrieves details about a specific scheduled query, including its configuration, execution status, and metadata.

See also: AWS API Documentation

Request Syntax

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

identifier (string) –

[REQUIRED]

The ARN or name 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 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.

    • queryString (string) –

      The query string executed by the scheduled query.

    • logGroupIdentifiers (list) –

      The log groups queried by the scheduled query.

      • (string) –

    • scheduleExpression (string) –

      The cron expression that defines when the scheduled query runs.

    • timezone (string) –

      The timezone used for evaluating the schedule expression.

    • startTimeOffset (integer) –

      The time offset in seconds that defines the lookback period for the query.

    • destinationConfiguration (dict) –

      Configuration for where query results are delivered.

      • s3Configuration (dict) –

        Configuration for delivering query results to Amazon S3.

        • destinationIdentifier (string) –

          The Amazon S3 URI where query results are delivered. Must be a valid S3 URI format.

        • roleArn (string) –

          The ARN of the IAM role that grants permissions to write query results to the specified Amazon S3 destination.

    • state (string) –

      The current state of the scheduled query.

    • lastTriggeredTime (integer) –

      The timestamp when the scheduled query was last executed.

    • lastExecutionStatus (string) –

      The status of the most recent execution of the scheduled query.

    • scheduleStartTime (integer) –

      The start time for the scheduled query in Unix epoch format.

    • scheduleEndTime (integer) –

      The end time for the scheduled query in Unix epoch format.

    • executionRoleArn (string) –

      The ARN of the IAM role used to execute the query and deliver results.

    • creationTime (integer) –

      The timestamp when the scheduled query was created.

    • lastUpdatedTime (integer) –

      The timestamp when the scheduled query was last updated.

Exceptions