CloudWatchLogs
The object describing a CloudWatchLogs
event source type.
This event generates a AWS::Logs::SubscriptionFilter resource and specifies a subscription filter and associates it with the specified log group.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
FilterPattern:
String
LogGroupName:String
Properties
-
FilterPattern
-
The filtering expressions that restrict what gets delivered to the destination AWS resource. For more information about the filter pattern syntax, see Filter and Pattern Syntax.
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is passed directly to the
FilterPattern
property of anAWS::Logs::SubscriptionFilter
resource. -
LogGroupName
-
The log group to associate with the subscription filter. All log events that are uploaded to this log group are filtered and delivered to the specified AWS resource if the filter pattern matches the log events.
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is passed directly to the
LogGroupName
property of anAWS::Logs::SubscriptionFilter
resource.
Examples
Cloudwatchlogs Subscription filter
Cloudwatchlogs Subscription filter Example
YAML
CWLog: Type: CloudWatchLogs Properties: LogGroupName: Ref: CloudWatchLambdaLogsGroup FilterPattern: My pattern