Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

trigger lambda function from log write in cloudwatch log group

I've setup some aws cloudwatch agents to send logs to a cloudwatch log group and what I want to do now is get those into an elasticsearch cluster (on ec2). Ideally, what I want to do is write a lambda function that parses it and then sends it to elasticsearch, but also have the lambda function be triggered anytime a message is written to the log group. Is it possible to trigger lambda from a cloudwatch log group?

like image 631
lightweight Avatar asked Oct 21 '25 07:10

lightweight


1 Answers

Subscribing AWS Lambda functions to CloudWatch Logs is documented here. Also, streaming CloudWatch Logs to the AWS ElasticSearch service is documented here.

like image 164
Mark B Avatar answered Oct 22 '25 23:10

Mark B