How to create one metrics filter for multiple CloudWatch log groups?

0

I have created Lambda function testA and testB with exactly the same source code.

lambda_function.py

def lambda_handler(event, context):
    print(event)

Executing these functions will print the value of the event variable to the log groups "/aws/lambda/testA" and "/aws/lambda/testB".
I want to filter the event variable values in these logs and record them in the same metrics. How can I create a metrics filter?

asked a year ago1820 views
1 Answer
1
Accepted Answer

CloudWatch metric filters are restricted to a single log group. There is not a way to set up a single metric filter to cover multiple log groups at present.

You can setup one metric filter for each log group. You can then use Metric Insights to combine those component metrics at query time for either an alarms or dashboards.

AWS
tichenm
answered a year ago
profile pictureAWS
EXPERT
kentrad
reviewed a year ago
  • Oh, I see, so I can only set one metrics filter per log group.

    You can setup one metric filter for each log group. You can then use Metric Insights to combine those component metrics at query time for either an alarms or dashboards.

    I will try it that way. Thank you !

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions