Question 131 · 475 in bank
A company hosts a web application on an Amazon EC2 instance. The web server logs are published to Amazon CloudWatch Logs. The log events have the same structure and include the HTTP response codes that are associated with the user requests. The company needs to monitor the number of times that the web server returns an HTTP 404 response. What is the MOST operationally efficient solution that meets these requirements?
Show answer
Answer: A
Explanation
Option A (Create a CloudWatch Logs metric filter that counts the number of times that the web server returns an HTTP 404 response) is the most operationally efficient solution. With a CloudWatch Logs metric filter, you can extract and count occurrences of specific patterns within your log data and create a custom metric based on those occurrences. In this case, you can create a metric filter that looks for the HTTP 404 response code in the log events and increments a counter for each occurrence. This way, you get a dedicated CloudWatch metric that represents the count of 404 responses, making it easy to set up alarms, dashboards, and other monitoring configurations based on this metric.
Source: Adapted from community discussion — Christina666