I am trying to send two lots of logs up to CloudWatch.
Here are the two logs:
- /var/log/apache2/access.log
- /var/log/apache2/error.log
I used the amazon-cloudwatch-agent-config-wizard to create the config file, and here is a snippet of the file showing the correct file path:
"collect_list": [
{
"file_path": "/var/log/apache2/access.log",
"log_group_name": "*group_name*",
"log_stream_name": "apache-access"
},
{
"file_path": "/var/log/apache2/error.log",
"log_group_name": "group-name*",
"log_stream_name": "apache-error"
}
]
I loaded in the config with:
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s
And ran into no errors and no errors and showing in the amazon-cloudwatch-agent.log.
Checking the status of the Amazon CloudWatch Agent shows it is running and has not errors. Also states the schema is valid.
The unique part of all of this is that I have removed the old CloudWatch agent and installed the new one. I have done this on two EC2 instances, one of which everything is working perfectly on, and the other one is not sending the logs to CloudWatch.
In a nutshell, why aren't the logs going up to CloudWatch? What can I do to troubleshoot this?
Any help will be appreciated.