Skip to main content

CloudWatch Logs Put Metric Filter

Creates or updates a metric filter and associates it with the specified log group. Metric filters allow you to configure rules to extract metric data from log events ingested through PutLogEvents.

The maximum number of metric filters that can be associated with a log group is 100.

When you create a metric filter, you can also optionally assign a unit and dimensions to the metric that is created.

note

Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric.

To help prevent accidental high charges, Amazon disables a metric filter if it generates 1000 different name/value pairs for the dimensions that you have specified within a certain amount of time.

You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges.

External Documentation

To learn more, visit the AWS documentation.

Basic Parameters

ParameterDescription
AWS Region(s)Enter the desired AWS Region(s).

To execute the action in multiple regions, provide a comma-separated list.
For example: us-east-1,eu-west-2.

If you wish to run the action in all available regions, use the asterisk symbol (*) instead.
Filter NameA name for the metric filter.
Filter PatternA filter pattern for extracting metric data out of ingested log events.

Input example:
[ip, identity, user_id, timestamp, request, status_code, size]
Log Group NameThe name of the log group.
Metric TransformationsA collection of information that defines how metric data gets emitted.

Input example:
[
{
"metricValue": "4",
"metricNamespace": "MyApp",
"metricName": "Volume"
}
]
Array of MetricTransformation objects.

Advanced Parameters

ParameterDescription
Disable XML To JSON Auto ConvertWhen checked, XML responses are not automatically converted into JSON format.

Automation Library Example

Cloudwatch Logs Put Metric Filter with Aws and Send Results Via Email

Automation LibraryPreview this Automation on desktop