Cloudwatch - parse log and look for 2 different things

0

Afternoon all. I have a server that is putting out a log directly to cloudwatch, pretty simple, the first value is either INFO, WARNING or ERROR then other data. I wish to count and graph the warnings and errors in cloudwatch and have this running with 2 metric filters. I have a few other projects and before I do this, I was reading a bit on dimensions, but the apache example is a bit tough to follow, so before I really spend the time, can I create 1 metric filter, separate those values and graph/count them separate OR am I better using 2 metrics. I know they charge the more you have, and I want to understand the dimension part as I have a few other projects and want to fully understand this.

Thanks!

asked 10 months ago418 views
1 Answer
1
Accepted Answer

Only one metric will be created per metric filter.
So if you want to create two metrics, you need to create two metrics filters.
As described in the documentation, dimensions serve as unique identifiers of metrics.
In other words, it is used to add an additional perspective to something that cannot be distinguished by namespace and metric name alone.
Therefore, even if multiple metrics filters have the same metric name, they can be identified by separating the dimensions.
Setting a dimension does not separate the two metrics.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringLogData.html

profile picture
EXPERT
answered 10 months ago

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