简体   繁体   中英

How to make CloudWatch logs agent running properly?

What I'm trying to do is to monitor log file through CloudWatch logs agent.

I have installed CloudWatch to my EC2 Linux Instance (EC2 Instance has Instance profile and IAM Role that are connected). The installation was successful, but when I'm using sudo service awslogs status I'm having this status massage dead but pid file exists .

In my error log file ( /var/log/awslogs.log) I have only this line that repeats over and over again - 'AccessKeyId'.

How can I fix Cloud Watch logs agent and make it to work?

This means that your AWS Logs agent requires your AWS Access Key/Secret. This can be provided in /etc/awslogs/awscli.conf in following format:

[plugins]
cwlogs = cwlogs
[default]
region = YOUR_INSTANCE_REGION (e.g. us-east-1)
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY

Restart the service after making this change:

sudo service awslogs restart

Hope this helps!!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM