2

I have awsService.log logs being sent to CloudWatch and I want to create a metric filter to extract the error value.

Example:

06/13/2020 07:35:33 : 578 : 3 : error occurs

05/13/2020 07:35:33 : 3 : 3 : error occurs

The error value I would like to extract is : 3

I tried with many regrex expressions like * : * : 3 : but it doesnot work.

Any help would be appreciated.

1 Answers1

0

Unfortunately no complex patterning (such as Regex) is currently supported with Metric Filters.

According to the documentation you have 3 choices

  • Trying to match based on an exact string ([": 3 :"])
  • Using JSON metric filters (not possible for your example as it requires JSON)
  • Filtering based on condition of this being a space separated event ([date, time, seperator1, int1, seperator2, int2=3, ...])

Regarding extracting the error value, Metrics Filters provide a count for every time this event occurs, they don't count values from the query itself.

Chris Williams
  • 32,215
  • 4
  • 30
  • 68