An AWS CloudWatch metric filter
allows you to specify string patterns that will, when encountered in your CloudWatch logs, trigger
the sending of a notification. This is useful if, for example, you want to be notified of certain
errors, but not of every message that is written to your CloudWatch logs.
About this task
The AWS article
Create a metric filter for a log group
served as the basis for the following procedure.
Procedure
- In a web browser, open the CloudWatch console at:
- Select .
- Select the check box in front of your log group name.
- Select .
- In the Filter pattern field, enter a log filter pattern that will
set off notifications.
This pattern triggers a notification each time a string is encountered in the logs that contains
the error code AQT10003E.
- Click Next. Then enter a name for your metric filter.
- In the Metric namespace field, enter the namespace name or leave
this field blank and make sure that Create new is selected.
- In the Metric name field, enter a name for your
metric.
- In the Metric value field, enter 1, so that a single occurrence of
the pattern sets off a notification.
- From the Unit drop-down list, select Count
as the unit of your metric value.
- Click Next to review your metric filter.
- Click Create metric filter.