0
votes

I am filtering logs using metric filter. But that filter is not giving exactly what I want.

Please do someone suggest me how I could get the API calls that are failed from the log group and send the response of the failed event as an input to the alarm that is triggered which calls SNS topic which in turn calls Lambda function. Lambda function then receives the SNS message with the response for further processing.

(OR)

Is there any other way to get the failure response from the log group based on any pattern and send the failure response to the lambda function?

1

1 Answers

0
votes

Is there any other way to get the failure response from the log group based on any pattern and send the failure response to the lambda function?

Instead of using metric filters and alarms, you can setup subscription filter on your log group.

The subscription can be set to stream your log data in real-time to a lambda function. How to do this is shown in the AWS docs here.

The lambda function could process the logs data, identify those of interest to you, and send to SNS topic to be picked up by other function.