DOP-C02 - Monitoring and Logging (15% of the exam) - Section 4.3

Audit, monitor and analyse logs and metrics with Amazon CloudWatch Logs Insights, AWS CloudTrail, Amazon Athena and CloudWatch anomaly detection.

Query log data interactively with CloudWatch Logs Insights and look up recent API activity through AWS CloudTrail event history, then aggregate events across accounts in a CloudTrail Lake event data store. Run ad hoc analysis over large log archives in Amazon S3 with Amazon Athena, and enable CloudWatch anomaly detection to surface unusual metric patterns.

CloudWatch Logs InsightsAWS CloudTrailAmazon AthenaAnomaly detection

Practice question for this objective

Free sampleMonitoring and Loggingmedium

An application writes its logs to an Amazon CloudWatch Logs log group, and each authentication failure produces a log line containing the token AuthFailure. The security team wants to be notified through Amazon SNS whenever more than fifty such failures occur within any five-minute window, and they want to reuse the log data already in CloudWatch Logs rather than stand up a separate pipeline. Which TWO actions together deliver this alerting? (Select TWO.)

  • ASchedule a CloudWatch Logs Insights query every five minutes that counts AuthFailure lines and sends the count to the security team through Amazon SNS.
  • BCreate a CloudWatch Logs metric filter on the log group that matches the AuthFailure token and increments a custom CloudWatch metric for each matching log event. Correct
  • CAdd a subscription filter on the log group that streams matching events to an AWS Lambda function which tallies failures and publishes to Amazon SNS once fifty are seen.
  • DCreate a CloudWatch alarm on the metric that the filter produces, set its threshold above fifty over a five-minute period, and target the Amazon SNS topic. Correct
Alerting on a log pattern uses a CloudWatch Logs metric filter to count matches plus a CloudWatch alarm on that metric to notify through SNS. A metric filter converts each AuthFailure log event into an increment on a CloudWatch metric, and a CloudWatch alarm evaluating that metric over a five-minute window with a threshold above fifty publishes to Amazon SNS when breached; this reuses the existing log data and needs no extra consumer or polling job to detect the condition.

Why A is wrong: A scheduled Logs Insights query can count the lines and is tempting because it reuses the same data, but it relies on periodic polling, adds query cost, and reacts on a timer rather than driving a native alarm threshold.

Why B is correct: A metric filter scans incoming log events for the pattern and turns matches into a numeric metric, which is the native way to convert log lines into a measurable signal without a separate consumer.

Why C is wrong: A subscription filter into Lambda could count and notify and feels close, but it introduces function code and state to maintain when a metric filter plus alarm already counts and thresholds natively.

Why D is correct: An alarm evaluating the filter metric over a five-minute period fires when the count exceeds fifty and publishes to the SNS topic, delivering the threshold-based notification the team needs.

See more DOP-C02 practice questions, answers explained.

Exam traps in Monitoring and Logging

Answers that look right on this material and are not. Each one is a distractor from a different question in the DOP-C02 bank for this domain.

  • Grant the operations account an IAM role in every source account and write a Lambda function that periodically copies each account's metrics into the operations account for dashboarding.

    Why it is wrong: Cross-account roles plus a copying Lambda can move data, but it is custom code to build and maintain and duplicates metrics rather than using the managed cross-account viewing feature the requirement favours.

  • Stream the CloudTrail logs into an Amazon OpenSearch Service domain sized for two years of data, then have analysts run full-text searches and build dashboards whenever an investigation arises.

    Why it is wrong: An OpenSearch domain runs continuously and is billed for its provisioned nodes around the clock, which is wasteful for queries that occur only a few times a month and contradicts the pay-per-query requirement.

  • Create a CloudWatch metric filter that matches the 503 status and emits a custom metric per service, then build a CloudWatch dashboard to read the metric for the incident window after the failures occur.

    Why it is wrong: Metric filters only act on events ingested after the filter is created, so they cannot retrieve the 503 events from the previous two hours, and building per-service metrics on the fly is slower than querying the existing logs directly.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.