Added
A service writes JSON application events to CloudWatch Logs. The operations team needs a metric that counts only events where the field "severity" equals "ERROR" and "service" equals "checkout". A CloudWatch alarm must notify the on-call team when the count exceeds a threshold. The log group already receives the events, and the team wants to avoid exporting and processing the logs separately. Which solution is best?
A CloudWatch Logs metric filter can match the JSON fields and publish a metric for matching events. A CloudWatch alarm can then evaluate that metric and notify the configured on-call action. A subscription filter routes log data to a destination but does not itself produce the required alarm metric, and bucket size would not represent matching error events. Contributor Insights analyzes patterns and contributors rather than directly implementing this exact counter. AWS Config evaluates resource configuration, not individual application log events.