CloudWatchLogs / Client / list_scheduled_queries

list_scheduled_queries

CloudWatchLogs.Client.list_scheduled_queries(**kwargs)

Lists all scheduled queries in the current AWS account and region with optional filtering by state.

See also: AWS API Documentation

Request Syntax

response = client.list_scheduled_queries(
    maxResults=123,
    nextToken='string',
    state='ENABLED'|'DISABLED'
)
Parameters:
  • maxResults (integer) – The maximum number of scheduled queries to return in a single call.

  • nextToken (string) – The token for the next set of items to return. The token expires after 24 hours.

  • state (string) – Filter results by the state of scheduled queries (ENABLED or DISABLED).

Return type:

dict

Returns:

Response Syntax

{
    'nextToken': 'string',
    'scheduledQueries': [
        {
            'scheduledQueryArn': 'string',
            'name': 'string',
            'state': 'ENABLED'|'DISABLED',
            'lastTriggeredTime': 123,
            'lastExecutionStatus': 'Running'|'InvalidQuery'|'Complete'|'Failed'|'Timeout',
            'scheduleExpression': 'string',
            'timezone': 'string',
            'destinationConfiguration': {
                's3Configuration': {
                    'destinationIdentifier': 'string',
                    'roleArn': 'string'
                }
            },
            'creationTime': 123,
            'lastUpdatedTime': 123
        },
    ]
}

Response Structure

  • (dict) –

    • nextToken (string) –

      The token for the next set of items to return. The token expires after 24 hours.

    • scheduledQueries (list) –

      The list of scheduled queries with summary information.

      • (dict) –

        Summary information about a scheduled query, used in list operations.

        • scheduledQueryArn (string) –

          The ARN of the scheduled query.

        • name (string) –

          The name of the scheduled query.

        • state (string) –

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

        • lastTriggeredTime (integer) –

          The time when the scheduled query was last executed.

        • lastExecutionStatus (string) –

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

        • scheduleExpression (string) –

          The cron expression that defines when the scheduled query runs.

        • timezone (string) –

          The timezone in which the schedule expression is evaluated.

        • 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.

        • creationTime (integer) –

          The time when the scheduled query was created.

        • lastUpdatedTime (integer) –

          The time when the scheduled query was last updated.

Exceptions