Q14 — AWS DOP-C02 Ch.3
Question 14 of 100 | ← Chapter 3
A company is deploying a new application using Amazon EC2 instances. The company needs a solution to query application logs and AWS account API activity. Which solution satisfies these requirements?
- A. Use the Amazon CloudWatch Agent to send logs from EC2 instances to Amazon CloudWatch Logs. Configure AWS CloudTrail to deliver API logs to Amazon S3. Use CloudWatch to query both log sets.
- B. Use the Amazon CloudWatch Agent to send logs from EC2 instances to Amazon CloudWatch Logs. Configure AWS CloudTrail to deliver API logs to CloudWatch Logs. Use CloudWatch Logs Insights to query both log sets. ✓
- C. Use the Amazon CloudWatch Agent to send logs from EC2 instances to Amazon Kinesis. Configure AWS CloudTrail to deliver API logs to Kinesis. Use Kinesis to load data into Amazon Redshift. Use Amazon Redshift to query both log sets.
- D. Use the Amazon CloudWatch Agent to send logs from EC2 instances to Amazon S3. Use AWS CloudTrail to deliver API logs to Amazon S3. Use Amazon Athena to query both log sets in Amazon S3.
Correct Answer: B. Use the Amazon CloudWatch Agent to send logs from EC2 instances to Amazon CloudWatch Logs. Configure AWS CloudTrail to deliver API logs to CloudWatch Logs. Use CloudWatch Logs Insights to query both log sets.
Explanation
A: You cannot use CloudWatch to query anything—you must use CloudWatch Logs Insights. Even then, CloudWatch Logs Insights cannot query S3. B: Correct. Configuration and usage are straightforward. C: Why use this complex, expensive solution? Redshift is overkill and costly. D: While feasible, logs are better stored and queried in CloudWatch Logs rather than S3 for real-time analysis and lower operational overhead.