Title: - How to monitor Free Text patterns from Application Logs in AWS Current Situation: - Unable to monitor free-text patterns like ERROR (Error code 404,200,204 etc.), Warning, DEBUG that generally comes in application logs of the webserver. In general, logs get collected in AWS CloudWatch Logs Groups and we are unable to monitor these free-text patterns in cloud watch as there are no such metrics available in AWS CloudWatch. Solution: The solution for the above-mentioned issue is as follows: • Create one customized IAM Policy which will grant access to AWS logs and AWS cloud watch. • Create one IAM role with the above create IAM policy and attached it to the Webserver/EC2 instance (on which application is running). • Go to Webserver/EC2 instance update yum packages if not up to date and install awslogs package. • Do the customization in the AWS Logs configuration file (specify region name, application path, application log file, etc., etc.) • Start and enable the AWS logsd service. • Go to AWS Cloud watch and create the metric filter with Filter names like ERROR, WARNING, DEBUG, etc. • Also, create the SNS topic on which you want to receive the alerts of the respective alarm. • Lastly, create the AWS Cloud watch alarms with the respective metric that you have created above.

Share this project: