A developer has installed and configured the Unified CloudWatch Agent on a fleet of Amazon EC2 instances to stream application logs to Amazon CloudWatch Logs. However, after starting the agent, the developer notices that no log groups or log streams are being created in the CloudWatch console.
Which TWO actions should the developer take to troubleshoot and resolve this issue?
- Verify that the IAM role attached to the EC2 instances contains the permissions from the CloudWatchAgentServerPolicy AWS-managed policy.Cevap
- Check the CloudWatch agent log file on the EC2 instances for configuration errors or AWS API credential issues.Cevap
- CVerify that the Metric Filter patterns associated with the target log group match the format of the incoming logs.
- DEnsure that the application Nginx service execution timeout is configured to match the CloudWatch log streaming visibility window.
- EModify the IAM trust policy of the EC2 instance role to allow the logs.amazonaws.com service principal to assume the role.
Cevap
Verify that the IAM role attached to the EC2 instances contains the permissions from the CloudWatchAgentServerPolicy AWS-managed policy, and check the CloudWatch agent log file on the EC2 instances for configuration errors or AWS API credential issues.
The correct steps to troubleshoot missing logs in CloudWatch when using the Unified CloudWatch Agent are verifying the IAM permissions of the EC2 instance (which must include permissions to publish logs) and checking the agent's local log file for errors. The CloudWatchAgentServerPolicy contains the required permissions, and the local agent log file provides diagnostic details.
Adım Adım Çözüm
Anahtar Kavram
CloudWatch Logs Ingestion and Troubleshooting