简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM