Skip to content
v2.273.0

SubscriptionFilterOptions Struct ​

Properties for a new SubscriptionFilter created from a LogGroup.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_logs as logs } from 'aws-cdk-lib';

declare const filterPattern: logs.IFilterPattern;
declare const logSubscriptionDestination: logs.ILogSubscriptionDestination;
const subscriptionFilterOptions: logs.SubscriptionFilterOptions = {
  destination: logSubscriptionDestination,
  filterPattern: filterPattern,

  // the properties below are optional
  distribution: logs.Distribution.BY_LOG_STREAM,
  filterName: 'filterName',
};

Properties ​

The destination to send the filtered events to.

For example, a Kinesis stream or a Lambda function.

distributionDistributiondistributionDistributiondistributionDistributionDistributionDistributionDistributionDistribution= Distribution.BY_LOG_STREAM#
The method used to distribute log data to the destination.

This property can only be used with KinesisDestination.

filterNamestringfilter_namestrfilterNameStringFilterNamestringFilterName*string= Automatically generated#
The name of the subscription filter.
filterPatternIFilterPatternfilter_patternIFilterPatternfilterPatternIFilterPatternFilterPatternIFilterPatternFilterPatternIFilterPatternrequired#
Log events matching this pattern will be sent to the destination.