0
votes

In AWS CloudWatch, I have created a log metric filter to check a CloudWatch log group for a specific search term ("ERROR") and to consider an instance of this term to be a metric value of "1":

enter image description here

I think this is correct: every time CloudWatch scans the log group and finds an instance of "ERROR" I want that to be considered 1 instance or occurrence of the issue.

I then created a CloudWatch Alarm on this metric:

enter image description here

If I understand CloudWatch Alarms, this means I've configured it to "sound the alarm" and fire a notification anytime we receive a single "ERROR" in the logs inside a given hour of time (60 data points).

So I created this Log Error Alarm and in the Alarm Dashboard I see it as green/ok/active:

enter image description here

and:

enter image description here

Two field descriptors in those last 2 screenshots are throwing me off:

  • Threshold; and
  • Period

For Threshold, how and where did I configure it inside a given 5 hour span of time?

For Period, how and where did I configure it to scan/fire every 5 minutes?

1

1 Answers

1
votes

Threshold is 5 hours because you set the metric period to 5 minutes, which means each datapoint covers the span of 5 minutes, and you set it to alarm after 60 datapoints (60 * 5 = 300 minutes, or 5 hours).

To change the period select the alarm and click Actions -> Modify. On the edit screen, click Edit on the top left, next to the Metric title. There you can change the period to 1 minute.