CloudWatch: count number of requests from cloudwatch logs and create alarm

0

I am logging userid in cloudwatch logs and need to count the no. of requests for the same userid in last 1 hour and have to create an alarm. Basically need to do that for each userid. So is there a way we can achieve this using Cloudwatch metric? Or any other AWS service?

已提问 1 年前717 查看次数
1 回答
0

If I understood your requirement correctly you have a log group that captures records of user logging which includes the userid field and you need to set an alarm if one or many of these userids if they reach a certain threshold within an hour.

I would suggest creating a metric filter on your log group as described here -> https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CreateMetricFilterProcedure.html

Then setup a cloudwatch alarm based on the metric filter you created -> https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_alarm_log_group_metric_filter.html

profile picture
Bisina
已回答 1 年前
  • so I need to setup this for each user id?

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

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

回答问题的准则