An application writes audit messages to local files on several EC2 instances. The team needs to store these messages centrally in CloudWatch Logs while keeping each instance's records distinguishable. What should the engineer configure?
Show the answer
Correct answerA. A CloudWatch agent configuration using a shared log group and instance-specific log streams.
AWhy this is right: The agent collects the files, and instance-specific log streams preserve the source identity within a shared log group.
BWhy not this: Logs Insights queries logs already ingested into CloudWatch Logs; it does not collect files from EC2 instances.
CWhy not this: Detailed monitoring publishes EC2 metrics; it does not upload application log files.
DWhy not this: CloudTrail captures supported API activity rather than collecting the application's local log files.
The CloudWatch agent can collect local application log files into a shared log group with separate streams for each instance. CloudTrail records supported AWS API activity, not arbitrary application messages written to local files.