SubscriptionFilterOptions Struct
Properties for a new SubscriptionFilter created from a LogGroup.
| Source | aws-logs/lib/log-group.ts |
|---|---|
| Type last changed |
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',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_logs as logs
# filter_pattern: logs.IFilterPattern
# log_subscription_destination: logs.ILogSubscriptionDestination
subscription_filter_options = logs.SubscriptionFilterOptions(
destination=log_subscription_destination,
filter_pattern=filter_pattern,
# the properties below are optional
distribution=logs.Distribution.BY_LOG_STREAM,
filter_name="filterName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.logs.*;
IFilterPattern filterPattern;
ILogSubscriptionDestination logSubscriptionDestination;
SubscriptionFilterOptions subscriptionFilterOptions = SubscriptionFilterOptions.builder()
.destination(logSubscriptionDestination)
.filterPattern(filterPattern)
// the properties below are optional
.distribution(Distribution.BY_LOG_STREAM)
.filterName("filterName")
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Logs;
IFilterPattern filterPattern;
ILogSubscriptionDestination logSubscriptionDestination;
var subscriptionFilterOptions = new SubscriptionFilterOptions {
Destination = logSubscriptionDestination,
FilterPattern = filterPattern,
// the properties below are optional
Distribution = Distribution.BY_LOG_STREAM,
FilterName = "filterName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var filterPattern IFilterPattern
var logSubscriptionDestination ILogSubscriptionDestination
subscriptionFilterOptions := &SubscriptionFilterOptions{
Destination: logSubscriptionDestination,
FilterPattern: filterPattern,
// the properties below are optional
Distribution: awscdk.Aws_logs.Distribution_BY_LOG_STREAM,
FilterName: jsii.String("filterName"),
}
Properties
destinationILogSubscriptionDestinationdestinationILogSubscriptionDestinationdestinationILogSubscriptionDestinationDestinationILogSubscriptionDestinationDestinationILogSubscriptionDestination required #The destination to send the filtered events to.
For example, a Kinesis stream or a Lambda function.
distributionoptionalDistributiondistributionoptionalDistributiondistributionoptionalDistributionDistributionoptionalDistributionDistributionoptionalDistribution = Distribution.BY_LOG_STREAM #The method used to distribute log data to the destination.
This property can only be used with KinesisDestination.
filterNameoptionalstringfilter_nameoptionalstrfilterNameoptionalStringFilterNameoptionalstringFilterNameoptional*string #The name of the subscription filter.
Default: Automatically generated
filterPatternIFilterPatternfilter_patternIFilterPatternfilterPatternIFilterPatternFilterPatternIFilterPatternFilterPatternIFilterPattern required #Log events matching this pattern will be sent to the destination.