CloudWatchLogs / Client / update_scheduled_query

update_scheduled_query

CloudWatchLogs.Client.update_scheduled_query(**kwargs)

Updates the configuration of an existing scheduled query. This operation follows PUT semantics, replacing the existing configuration with the provided values.

See also: AWS API Documentation

Request Syntax

response = client.update_scheduled_query(
    identifier='string',
    description='string',
    queryLanguage='CWLI'|'SQL'|'PPL',
    queryString='string',
    logGroupIdentifiers=[
        'string',
    ],
    scheduleExpression='string',
    timezone='string',
    startTimeOffset=123,
    destinationConfiguration={
        's3Configuration': {
            'destinationIdentifier': 'string',
            'roleArn': 'string'
        }
    },
    scheduleStartTime=123,
    scheduleEndTime=123,
    executionRoleArn='string',
    state='ENABLED'|'DISABLED'
)
Parameters:
  • identifier (string) –

    [REQUIRED]

    The name or ARN of the scheduled query to update.

  • description (string) – Updated description for the scheduled query.

  • queryLanguage (string) –

    [REQUIRED]

    Updated query language to use (LogsQL, PPL, or SQL).

  • queryString (string) –

    [REQUIRED]

    Updated CloudWatch Logs Insights query string to execute.

  • logGroupIdentifiers (list) –

    Updated log group identifiers to query.

    • (string) –

  • scheduleExpression (string) –

    [REQUIRED]

    Updated cron expression that defines when the scheduled query runs.

  • timezone (string) – Updated timezone in which the schedule expression is evaluated.

  • startTimeOffset (integer) – Updated time offset in seconds from the execution time for the start of the query time range.

  • destinationConfiguration (dict) –

    Updated configuration for destinations where the query results will be delivered.

    • s3Configuration (dict) – [REQUIRED]

      Configuration for delivering query results to an Amazon S3 bucket.

      • destinationIdentifier (string) – [REQUIRED]

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

      • roleArn (string) – [REQUIRED]

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

  • scheduleStartTime (integer) – Updated start time for the query schedule in Unix epoch time.

  • scheduleEndTime (integer) – Updated end time for the query schedule in Unix epoch time.

  • executionRoleArn (string) –

    [REQUIRED]

    Updated ARN of the IAM role that CloudWatch Logs will assume to execute the scheduled query.

  • state (string) – Updated state of the scheduled query (ENABLED or DISABLED).

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 updated scheduled query.

    • name (string) –

      The name of the updated scheduled query.

    • description (string) –

      The description of the updated scheduled query.

    • queryLanguage (string) –

      The query language used by the updated scheduled query.

    • queryString (string) –

      The query string of the updated scheduled query.

    • logGroupIdentifiers (list) –

      The log group identifiers of the updated scheduled query.

      • (string) –

    • scheduleExpression (string) –

      The schedule expression of the updated scheduled query.

    • timezone (string) –

      The timezone of the updated scheduled query.

    • startTimeOffset (integer) –

      The start time offset of the updated scheduled query.

    • destinationConfiguration (dict) –

      The destination configuration of the updated scheduled query.

      • 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 state of the updated scheduled query.

    • lastTriggeredTime (integer) –

      The time when the updated scheduled query was last executed.

    • lastExecutionStatus (string) –

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

    • scheduleStartTime (integer) –

      The schedule start time of the updated scheduled query.

    • scheduleEndTime (integer) –

      The schedule end time of the updated scheduled query.

    • executionRoleArn (string) –

      The execution role ARN of the updated scheduled query.

    • creationTime (integer) –

      The creation time of the updated scheduled query.

    • lastUpdatedTime (integer) –

      The last updated time of the scheduled query.

Exceptions

  • CloudWatchLogs.Client.exceptions.ValidationException

  • CloudWatchLogs.Client.exceptions.AccessDeniedException

  • CloudWatchLogs.Client.exceptions.ResourceNotFoundException

  • CloudWatchLogs.Client.exceptions.ThrottlingException

  • CloudWatchLogs.Client.exceptions.InternalServerException