aws-cdk-lib.aws_logs.SubscriptionFilterProps

interface SubscriptionFilterProps

LanguageType name
.NETAmazon.CDK.AWS.Logs.SubscriptionFilterProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslogs#SubscriptionFilterProps
Javasoftware.amazon.awscdk.services.logs.SubscriptionFilterProps
Pythonaws_cdk.aws_logs.SubscriptionFilterProps
TypeScript (source)aws-cdk-lib » aws_logs » SubscriptionFilterProps

Properties for a SubscriptionFilter.

Example

import * as destinations from 'aws-cdk-lib/aws-logs-destinations';
declare const fn: lambda.Function;
declare const logGroup: logs.LogGroup;

new logs.SubscriptionFilter(this, 'Subscription', {
  logGroup,
  destination: new destinations.LambdaDestination(fn),
  filterPattern: logs.FilterPattern.allTerms("ERROR", "MainThread"),
});

Properties

NameTypeDescription
destinationILogSubscriptionDestinationThe destination to send the filtered events to.
filterPatternIFilterPatternLog events matching this pattern will be sent to the destination.
logGroupILogGroupThe log group to create the subscription on.

destination

Type: ILogSubscriptionDestination

The destination to send the filtered events to.

For example, a Kinesis stream or a Lambda function.


filterPattern

Type: IFilterPattern

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


logGroup

Type: ILogGroup

The log group to create the subscription on.