The company needs a solution to query application logs from EC2 instances and AWS account API activity. Which setup satisfies this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Install the CloudWatch agent on the EC2 instances to forward logs to CloudWatch Logs. Configure CloudTrail to deliver API activity logs to CloudWatch Logs. Use CloudWatch Logs Insights to query both the application and API logs..
Why this is the answer
The correct solution leverages CloudWatch Logs as a centralized repository for both application and API activity logs, and CloudWatch Logs Insights for efficient querying. The CloudWatch agent on EC2 instances can directly forward application logs to CloudWatch Logs. CloudTrail can be configured to deliver API activity logs to a CloudWatch Logs log group. CloudWatch Logs Insights is specifically designed for interactive analysis of log data within CloudWatch Logs, making it ideal for querying both types of logs from a single interface. Incorrect options: Using CloudWatch to query logs when CloudTrail delivers to S3 would require additional integration or separate querying mechanisms, not a unified solution. Streaming logs to Kinesis and then Redshift adds unnecessary complexity and cost if the primary goal is just querying, as CloudWatch Logs Insights offers a simpler, integrated solution for this use case. Storing logs in S3 and using Athena is a viable option for querying, but CloudWatch Logs Insights provides a more integrated and often simpler experience for real-time log analysis directly within the CloudWatch ecosystem, especially for operational insights.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed