Cloudwatch logs from EC2 Instance, Ubuntu
HTML-код
- Опубликовано: 23 янв 2025
- Send Apache Web Server's Access logs and Error logs to cloudwatch logs.
Install and configure cloudwatch agent on EC2 Instance , Ubuntu 20.04.
Provided role with necessary permission to EC2 instance in order to sent the logs to cloudwatch.
Cloudwatch log group will be created automaticall along with two log streams for apache's access log and error log respectively.
Steps to install and configure cloudwatch agent
1. wget s3.amazonaws.c...
2. sudo dpkg -i -E ./amazon-cloudwatch-agent.deb
3. sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
4. sudo apt-get update -y
5. sudo apt-get install collectd
6. 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
7. sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a status
You are my savior. only you show how to install cloudwatch in ubuntu. Thanks man.
Thanks...its really work😊😊😊
Thank you so much for this bhai !
Kindly like share and subscribe if you find that useful
I followed your video because my bootcamp video for this portion of my learning was out of date. this video really helped me get connected to cloudwatch! However none of my access and error log streams show a timestamp. I don't know if this is something I should be concerned with or not.. haha The Apache2 Ubuntu DNS default page showed up fine which means it is connected and I was able to find my EC2 log group.
Nice one ! - really helped :)
very useful
Hi, while I enter the cmd "sudo dpkg -i -E ./amazon-cloudwatch-agent.deb",
it shows error "dpkg: error processing archive ./amazon-cloudwatch-agent.deb (--install):
package architecture (arm64) does not match system (amd64)
Errors were encountered while processing:
./amazon-cloudwatch-agent.deb"
How could I resolve it ? Thank you. btw I'm using M1... 😞
Try to add amd64 architecture by command and try again
dpkg --add-architecture amd64
All are done but i cant see any link g group in my cloudwatch why? Followed all steps correctly
You can check the logs for the info residing in /var/log/amazon/amazon-cloudwatch-agent directory, mostly in file amazon-cloudwatch-agent.log...
I followed all the steps but at the end log group is not created, what's your suggestion? Thanks in advance.
You can check if the role that is attached to the instance has permission of cloudwatch logs...
@@webdevcloud1 if we add extra permissions to test this would we need to configure it all over again to create the log groups?
thanks!
Thanks