Question 518 of 1,740
Monitoring and LoggingmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is to install and configure the Amazon CloudWatch Logs agent on each EC2 instance to tail the log files from the EFS mount and stream them to CloudWatch Logs, then create a metric filter and alarm for 5xx errors. This solution works because the agent provides near-real-time log ingestion from a shared filesystem without requiring custom code or additional infrastructure, enabling centralized real-time monitoring of web server logs with minimal operational overhead. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding of agent-based log shipping versus pull-based solutions like Amazon Kinesis Agent or Lambda—a common trap is choosing a complex streaming pipeline when the simpler CloudWatch agent suffices for file tailing. Remember the memory tip: "Agent tails, filter hails"—the agent tails the file, and the metric filter hails the alarm on 5xx spikes.

DOP-C02 Monitoring and Logging Practice Question

This DOP-C02 practice question tests your understanding of monitoring and logging. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Your company runs a multi-tier web application on AWS. The application consists of an Application Load Balancer (ALB) that distributes traffic to a fleet of Amazon EC2 instances running a web server. The web servers write access logs to a shared Amazon EFS filesystem. The operations team needs to monitor the web server logs in real-time to detect and alert on 5xx error spikes. Currently, the team manually SSHes into instances to tail logs, which is inefficient and doesn't provide real-time alerting. The team wants a centralized, near-real-time logging solution with minimal operational overhead. They have asked you to design a solution that ingests logs from the EFS filesystem into a centralized log analytics platform. Which solution would you recommend?

Question 1mediummultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Install and configure the Amazon CloudWatch Logs agent on each EC2 instance to tail the log files from the EFS mount and send them to CloudWatch Logs. Create a metric filter and alarm for 5xx errors.

Option D is correct because installing the CloudWatch Logs agent on each EC2 instance allows it to tail the log files from the shared EFS mount point and stream them to CloudWatch Logs in near real-time. This provides centralized log ingestion with minimal operational overhead, and you can create a metric filter and alarm to detect and alert on 5xx error spikes without manual SSH access.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Enable AWS CloudTrail data events for the EC2 instances to capture log file modifications.

    Why it's wrong here

    CloudTrail captures API calls, not application log content.

  • Configure an Amazon EventBridge scheduled rule to invoke an AWS Lambda function that reads new log lines from EFS and publishes them to Amazon CloudWatch Logs.

    Why it's wrong here

    Lambda cannot directly read from EFS without mounting it, and scheduled polling is not near-real-time.

  • Stream the log files to Amazon Kinesis Data Streams using a custom producer, then use a Lambda function to analyze and alert on 5xx errors.

    Why it's wrong here

    This adds complexity; the custom producer on each instance is similar to installing the CloudWatch agent but with more overhead.

  • Install and configure the Amazon CloudWatch Logs agent on each EC2 instance to tail the log files from the EFS mount and send them to CloudWatch Logs. Create a metric filter and alarm for 5xx errors.

    Why this is correct

    The CloudWatch agent provides near-real-time log ingestion and built-in support for metric filters and alarms.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may overcomplicate the solution by choosing Kinesis or Lambda-based approaches (Options B and C) when a simple agent-based solution (Option D) is sufficient, or they may confuse CloudTrail data events (Option A) with log file monitoring, not realizing CloudTrail captures API activity, not file content changes.

Trap categories for this question

  • Similar concept trap

    This adds complexity; the custom producer on each instance is similar to installing the CloudWatch agent but with more overhead.

Detailed technical explanation

How to think about this question

The CloudWatch Logs agent uses a state file to track the last read position in each log file, ensuring that only new lines are sent even if the file is rotated or truncated. This agent supports tailing files from any mounted filesystem, including NFS-based EFS, and uses the PutLogEvents API to send logs to a log group and stream. In a real-world scenario, if the EFS mount is shared across many instances, each agent independently tails the same file, which can lead to duplicate log entries; to avoid this, you would configure the agent on a single instance or use a dedicated log shipper like Fluentd with a file-based input plugin.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DOP-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DOP-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DOP-C02 question test?

Monitoring and Logging — This question tests Monitoring and Logging — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Install and configure the Amazon CloudWatch Logs agent on each EC2 instance to tail the log files from the EFS mount and send them to CloudWatch Logs. Create a metric filter and alarm for 5xx errors. — Option D is correct because installing the CloudWatch Logs agent on each EC2 instance allows it to tail the log files from the shared EFS mount point and stream them to CloudWatch Logs in near real-time. This provides centralized log ingestion with minimal operational overhead, and you can create a metric filter and alarm to detect and alert on 5xx error spikes without manual SSH access.

What should I do if I get this DOP-C02 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.