A metric filter counts log events that match a pattern and publishes the count as a CloudWatch metric. You use it to count the ERROR lines of python-app, and alarm on that metric in section 5.

In Filter pattern enter the pattern below (1). Both terms must appear in a log event for it to match.
"python-app" "ERROR"


ERROR lines from python-app match. Choose Next (3).
PythonAppErrors (1) and Metric namespace FCJ/CloudWatchWorkshop (2).
PythonAppErrorCount (1)1 (2), each matching line adds 10 (3), so the metric is 0 instead of missing when there is no errorCount (4)



A metric filter only processes log events that arrive after it was created. It does not count older events.