Q61 — AWS DVA-C02 Ch.1
Question 61 of 100 | ← Chapter 1
A developer wants to search and filter log data to debug an application. Application logs are stored in Amazon CloudWatch Logs. The developer created a new metric filter to count exceptions in application logs. However, no results are returned from the filter. What is the reason no filter results are returned?
- A. An Amazon CloudWatch interface VPC endpoint must be configured to filter CloudWatch Logs within a VPC.
- B. CloudWatch Logs only publishes metric data for events occurring after the filter is created. ✓
- C. The log group must first stream logs to Amazon OpenSearch Service before metric filtering can return results.
- D. Metric data points from the log group can only be filtered after exporting logs to an Amazon S3 bucket.
Correct Answer: B. CloudWatch Logs only publishes metric data for events occurring after the filter is created.
Explanation
Amazon CloudWatch Logs metric filters generate metric data based on log events. This means metric filters process and generate metrics only for log events that occur after the filter is created. If the filter is created after relevant log events have already occurred, those earlier events will not be included in the metric data — resulting in empty filter output. Thus, the correct answer is B.