SubscriptionFilterProps

class aws_cdk.aws_logs.SubscriptionFilterProps(*, destination, filter_pattern, log_group)

Bases: aws_cdk.aws_logs.SubscriptionFilterOptions

Properties for a SubscriptionFilter.

Parameters
  • destination (ILogSubscriptionDestination) – The destination to send the filtered events to. For example, a Kinesis stream or a Lambda function.

  • filter_pattern (IFilterPattern) – Log events matching this pattern will be sent to the destination.

  • log_group (ILogGroup) – The log group to create the subscription on.

Example:

import aws_cdk.aws_logs_destinations as destinations
# fn is of type Function
# log_group is of type LogGroup


logs.SubscriptionFilter(self, "Subscription",
    log_group=log_group,
    destination=destinations.LambdaDestination(fn),
    filter_pattern=logs.FilterPattern.all_terms("ERROR", "MainThread")
)

Attributes

destination

The destination to send the filtered events to.

For example, a Kinesis stream or a Lambda function.

Return type

ILogSubscriptionDestination

filter_pattern

Log events matching this pattern will be sent to the destination.

Return type

IFilterPattern

log_group

The log group to create the subscription on.

Return type

ILogGroup