CloudWatchLogs - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

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 Amazon Serverless Application Model (Amazon SAM) template, use the following syntax.

YAML

FilterPattern: String LogGroupName: String

Properties

FilterPattern

The filtering expressions that restrict what gets delivered to the destination Amazon resource. For more information about the filter pattern syntax, see Filter and Pattern Syntax.

Type: String

Required: Yes

Amazon CloudFormation compatibility: This property is passed directly to the FilterPattern property of an AWS::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 Amazon resource if the filter pattern matches the log events.

Type: String

Required: Yes

Amazon CloudFormation compatibility: This property is passed directly to the LogGroupName property of an AWS::Logs::SubscriptionFilter resource.

Examples

Cloudwatchlogs Subscription filter

Cloudwatchlogs Subscription filter Example

YAML

CWLog: Type: CloudWatchLogs Properties: LogGroupName: Ref: CloudWatchLambdaLogsGroup FilterPattern: My pattern