Which solutions will meet these requirements?
(Choose two.)
Create a script on the EC2 instances to copy the log file contents to an Amazon S3 bucket. Add the script to an hourly cron schedule. Instruct the operations staff to retrieve the information from the S3 bucket directly.
Configure the Amazon CloudWatch agent configuration file to include the application log file details in the logs section. Instruct the operations staff to retrieve the information from the correct log group in Amazon CloudWatch Logs.
Configure the EC2 instances to use AWS Systems Manager. Configure appropriate permissions. Instruct the operations staff to examine the log file by invoking AWS Systems Manager Run Command.
Configure the EC2 instances to use AWS Systems Manager. Configure appropriate permissions. Instruct the operations staff to examine the log file by using AWS Systems Manager Session Manager.
Create a script on the EC2 instances to copy the log file contents to an Amazon S3 bucket. Add the script to an hourly cron schedule. Instruct the operations staff to retrieve the information by running Amazon Athena queries against the S3 data.
Explanations:
The script to copy the log file to S3 and running it on an hourly cron schedule will delay the log file availability. The events could take up to an hour to become available, which doesn’t meet the requirement of making log information available within 30 minutes.
Configuring the CloudWatch agent to send log file data to CloudWatch Logs ensures that the operations staff can access the latest log information within minutes. CloudWatch Logs can be configured to update in real-time or near-real-time, meeting the 30-minute window requirement.
Using AWS Systems Manager Run Command to retrieve log files allows the operations staff to access the latest log information without the need for interactive sessions. Systems Manager can access and retrieve logs from EC2 instances in near real-time, satisfying the 30-minute requirement.
AWS Systems Manager Session Manager requires an interactive session to view logs. This does not meet the requirement of retrieving logs without an interactive session.
Although copying logs to S3 via a script and querying them with Amazon Athena could work, the S3 copy operation would only run on an hourly schedule, which could delay access to the log data beyond the required 30-minute timeframe.