I want to collect logs from the Windows instances in my AWS Elastic Beanstalk environment.
To collect logs from the Windows instances in your Elastic Beanstalk environment, use the AWSSupport-CollectElasticBeanstalkLogs automation. For Windows instances, use the Remote Desktop Protocol (RDP) to connect to each individual Windows instance, and then collect logs one at a time. However, you can use AWSSupport-CollectElasticBeanstalkLogs automation to collect logs from multiple Windows instances automatically to avoid this manual process.
By default, the automation uploads the log bundles for your instances as .zip files to either of the following resources:
The automation collects log files from the following locations:
Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you're using the most recent AWS CLI version.
To run the automation, you can use the AWS Systems Manager console or AWS CLI.
To monitor the progress of your automation, complete the following steps:
1. Collect bundle logs and upload them to the default S3 bucket for Elastic Beanstalk in your account:
aws ssm start-automation-execution --document-name "AWSSupport-CollectElasticBeanstalkLogs"\ --parameters "InstanceId=INSTANCEID,\ EnvironmentId=ENVIRONMENTID,\ AutomationAssumeRole=AUTOMATIONROLE"
2. Collect bundle logs and upload them to your S3 bucket:
aws ssm start-automation-execution --document-name "AWSSupport-CollectElasticBeanstalkLogs"\ --parameters "InstanceId=INSTANCEID,\ EnvironmentId=ENVIRONMENTID,\ S3BucketName=BUCKETNAME,\ S3BucketPath=BUCKETPATH,\ AutomationAssumeRole=AUTOMATIONROLE"
3. Retrieve the execution output:
aws ssm get-automation-execution --automation-execution-id EXECUTIONID --output text --query 'AutomationExecution.Outputs'