DVA-C02 · Question #94
A developer wants to debug an application by searching and filtering log data. The application logs are stored in Amazon CloudWatch Logs. The developer creates a new metric filter to count exceptions
The correct answer is B. CloudWatch Logs only publishes metric data for events that happen after the filter is created.. CloudWatch Logs metric filters are not retroactive - they only process log events that are ingested after the filter is created, so previously stored log data produces no metric results.
Question
A developer wants to debug an application by searching and filtering log data. The application logs are stored in Amazon CloudWatch Logs. The developer creates a new metric filter to count exceptions in the application logs. However, no results are returned from the logs. What is the reason that no filtered results are being returned?
Options
- AA setup of the Amazon CloudWatch interface VPC endpoint is required for filtering the
- BCloudWatch Logs only publishes metric data for events that happen after the filter is created.
- CThe log group for CloudWatch Logs should be first streamed to Amazon OpenSearch Service
- DMetric data points for logs groups can be filtered only after they are exported to an Amazon S3
How the community answered
(24 responses)- A4% (1)
- B92% (22)
- D4% (1)
Why each option
CloudWatch Logs metric filters are not retroactive - they only process log events that are ingested after the filter is created, so previously stored log data produces no metric results.
A VPC endpoint for CloudWatch Logs is only required when the application runs in a private VPC with no internet access; it is not needed for metric filter functionality in a standard deployment.
When a metric filter is created, CloudWatch Logs begins monitoring new incoming log events against the filter pattern from that point forward. Log events that existed in the log group before the filter was created are never evaluated, which is why no results appear if all the exception log entries were generated before the filter was set up.
Streaming to OpenSearch Service is an optional integration for full-text search and analytics; metric filters work natively within CloudWatch Logs without any streaming configuration.
Exporting log groups to S3 is a separate archival feature; metric filters operate directly on data in CloudWatch Logs and do not require an S3 export to function.
Concept tested: CloudWatch Logs metric filter prospective-only evaluation
Source: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringLogData.html
Community Discussion
No community discussion yet for this question.