Skip to content

UI -> Cloudwatch Logs -> Metric Filters -> metric filters shows 50 values whereas we have 100 metric filters - CLI however shows 100 values

0

The Cloudwatch Logs Metric Filters only shows 50 values in the UI whereas we have 100 metric filters. The CLI however shows 100 values for that particular log group.

asked 2 years ago176 views

1 Answer
1

This discrepancy between the CloudWatch Logs console UI and the AWS CLI for displaying metric filters is likely due to pagination limitations in the console interface.

The CloudWatch console has a limit on the number of metric filters it can display at once, which appears to be 50 in your case. This is a common practice in web interfaces to manage large datasets and improve page load times.

However, the AWS CLI doesn't have the same display constraints as the web console. When you use the CLI command to describe metric filters for a log group, it retrieves all the metric filters associated with that log group, which in your case is 100.

To view all your metric filters in the console, you may need to look for pagination controls or a "Load more" option. If these aren't available, you might need to use the AWS CLI to get a complete list of your metric filters.

To list all metric filters using the AWS CLI, you can use the following command:

aws logs describe-metric-filters --log-group-name <YourLogGroupName>

This command will return all metric filters for the specified log group, including the filter name, creation time, filter pattern, and metric transformations for each filter.

If you need to work with all 100 metric filters regularly, it may be more efficient to use the AWS CLI or one of the AWS SDKs for programmatic access to this information, rather than relying on the console interface.
Sources
Listing metric filters - Amazon CloudWatch Logs
MetricFilter - Amazon CloudWatch Logs

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.