CloudWatchLogs.Client.
put_subscription_filter
(**kwargs)¶Creates or updates a subscription filter and associates it with the specified log group. With subscription filters, you can subscribe to a real-time stream of log events ingested through PutLogEvents and have them delivered to a specific destination. When log events are sent to the receiving service, they are Base64 encoded and compressed with the GZIP format.
The following destinations are supported for subscription filters:
Each log group can have up to two subscription filters associated with it. If you are updating an existing filter, you must specify the correct name in filterName
.
To perform a PutSubscriptionFilter
operation, you must also have the iam:PassRole
permission.
See also: AWS API Documentation
Request Syntax
response = client.put_subscription_filter(
logGroupName='string',
filterName='string',
filterPattern='string',
destinationArn='string',
roleArn='string',
distribution='Random'|'ByLogStream'
)
[REQUIRED]
The name of the log group.
[REQUIRED]
A name for the subscription filter. If you are updating an existing filter, you must specify the correct name in filterName
. To find the name of the filter currently associated with a log group, use DescribeSubscriptionFilters.
[REQUIRED]
A filter pattern for subscribing to a filtered stream of log events.
[REQUIRED]
The ARN of the destination to deliver matching log events to. Currently, the supported destinations are:
None
Exceptions
CloudWatchLogs.Client.exceptions.InvalidParameterException
CloudWatchLogs.Client.exceptions.ResourceNotFoundException
CloudWatchLogs.Client.exceptions.OperationAbortedException
CloudWatchLogs.Client.exceptions.LimitExceededException
CloudWatchLogs.Client.exceptions.ServiceUnavailableException