A company streams application logs to CloudWatch Logs. The development team must get an email when any log line contains the word "ERROR." The developer created an SNS topic and subscribed the team. What should the developer do next to send email notifications when "ERROR" appears in logs?
Choose an answer
Tap an option to check your answer.
Correct answer: Select the correct log group, create a CloudWatch Logs metric filter with "ERROR" as the filter pattern, then create a CloudWatch alarm on that metric that notifies the SNS topic when the metric is >= 1..
Why this is the answer
The correct approach involves a CloudWatch Logs metric filter, which transforms log data into numerical metrics that CloudWatch Alarms can monitor. First, you create a metric filter on the specific log group, using "ERROR" as the filter pattern. This filter counts occurrences of "ERROR" in the logs. Next, you create a CloudWatch Alarm that monitors this newly created metric. You configure the alarm to trigger when the metric (the count of "ERROR" occurrences) is greater than or equal to 1 within a specified period. Finally, you set the SNS topic as the alarm's action, ensuring the team receives an email notification. The other options are incorrect because: CloudWatch Logs Insights is for interactive querying and analysis, not for creating persistent alarms based on log patterns. SNS subscription filters are applied to messages published to an SNS topic, not to filter content directly from CloudWatch Logs. CloudWatch alarms do not directly include log content as a filter pattern; they monitor metrics, which can be derived from logs via metric filters.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed