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!

1 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen