Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single lambda, multiple cloudwatch log groups

After we run an AWS lambda, a single cloudwatch log group is populated. Is there a way we can populate two (different) cloudwatch log groups from a single AWS lambda? I searched about it but couldn't find an answer. Let me know if it is possible.

like image 445
Jayant Lohani Avatar asked Nov 03 '25 21:11

Jayant Lohani


1 Answers

It is not possible to specify two log groups from single lambda. If you need logs in two cloudwatch groups, you would need to be innovative and create subscription filter in cloudwatch group which stream logs to another lambda where you get logs as a payload and then from the second lambda you can save logs to another cloudwatch group. More info about cloudwatch subscriptions: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html

like image 112
zoran2709 Avatar answered Nov 05 '25 16:11

zoran2709