2
votes

I have to monitor CloudWatch logs for particular lambda. When the specific error message such as HTTP-50X is logged to CloudWatch, then we need to send an email notification to alert that the something is wrong.

We need help to create alert email in AWS to monitor manually the logs to see if there is any such error logged.

2
Are you looking for a solution precisely aims to use cloudwatch or any solution that may solve sending an email when error occurs in a particular lambda ?Ersoy
What's your question?TylerH
@Ersoy, Yes, need help to create alert email in AWS.user79319

2 Answers

2
votes

This is exactly what metric filter is for. Create a metric filter that monitors your log group for specific pattern. Then create a CloudWatch alarm based on a new metric and configure it with an SNS action. Then simply subscribe your email to that SNS topic.

All of this can be easily done via CloudFormation(Metric filter, Alarm, SNS). You can also use CDK.

1
votes

You can process/monitor logs in real-time using lambda functions. Checkout Using AWS Lambda with Amazon CloudWatch Logs and Real-time Processing of Log Data with Subscriptions for details.