Posted On: Feb 25, 2022

Amazon CloudWatch agent has added support for configurable log filter expressions. Customers can install and configure the CloudWatch agent to collect system and application logs from Amazon Elastic Compute Cloud (EC2), on-premises hosts, and containerized applications and send them to CloudWatch. This new configuration option is intended for users who want to collect only log events that meet specified criteria.

Using this new functionality of the CloudWatch agent, you can specify “match” and “exclude” regular expressions for each log stream in the agent configuration file. This will cause the agent to evaluate each log event against the expressions to determine whether the log event should be sent to CloudWatch. Log events not sent to CloudWatch are discarded. Log filters help you to manage your log ingestion by processing only log events that meet the specified criteria such as those that contain error codes or by eliminating verbose log events.

Amazon CloudWatch Agent is available in all commercial AWS Regions, and AWS GovCloud (US).

To get started, see Create or Edit the CloudWatch Agent Configuration File in the Amazon CloudWatch User Guide.