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?

feita há um ano717 visualizações
1 Resposta
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
respondido há um ano
  • so I need to setup this for each user id?

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas