AWS - CloudWatch Logs
AWS with Chetan AWS with Chetan
86.1K subscribers
90,609 views
0

 Published On Mar 11, 2019

How to stream Application logs from EC2 instance to CloudWatch and create an Alarm based on certain string pattern in the logs.

Useful contents:
1. IAM Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:DescribeLogStreams"
],
"Resource": [
"arn:aws:logs:*:*:*"
]
}
]
}

2. awslogs.conf file contents:
[general]
state_file = /var/lib/awslogs/agent-state
[application_logs]
region = ap-south-1
datetime_format = %b %d %H:%M:%S
file = /var/log/application.log
buffer_duration = 5000
log_stream_name = {instance_id}
initial_position = start_of_file
log_group_name = application_logs

If you like this video, you can get more content from me at https://www.awswithchetan.com/courses...

Hope you like it.

Happy learning !
~Chetan
Email: [email protected]
Email: [email protected]

show more

Share/Embed