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!

已提问 10 个月前442 查看次数
1 回答
1
已接受的回答

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
专家
已回答 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则