AWS::Logs::MetricFilterThe AWS::Logs::MetricFilter resource specifies a metric filter that describes how CWL extracts information from logs and transforms it into Amazon CloudWatch metrics. If you have multiple metric filters that are associated with a log group, all the filters are applied to the log streams in that group. The maximum number of metric filters that can be associated with a log group is 100.
7 configurable properties. 3 required. Click a row to see details.
| Property | Type | Flags |
|---|---|---|
FilterPattern | string | Required |
LogGroupName | string | RequiredCreate-only |
MetricTransformations | Array<MetricTransformation> | Required |
ApplyOnTransformedLogs | boolean | |
EmitSystemFieldDimensions | Array<string> | |
FieldSelectionCriteria | string | |
FilterName | string | Create-only |
A minimal template with required properties and common optional ones.
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::Logs::MetricFilter
Resources:
MyResource:
Type: AWS::Logs::MetricFilter
Properties:
FilterPattern: "value"
LogGroupName: "my-loggroupname"
MetricTransformations: []Permissions CloudFormation needs in your IAM role to manage this resource.
logs:DescribeMetricFilterslogs:PutMetricFilterlogs:DescribeMetricFilterslogs:PutMetricFilterlogs:DescribeMetricFilterslogs:DescribeMetricFilterslogs:DeleteMetricFilterOur bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to NewsletterLogGroupNameThese properties cannot be changed after the resource is created. Updating them triggers a replacement.
FilterNameLogGroupName