DVA-C02 · Question #680
A web application that runs on a fleet of Amazon EC2 instances sends logs to a log group in Amazon CloudWatch Logs. The logs are in the following format: [ip, id, user, timestamp, request, status_code
The correct answer is B. Create metric filter on the log group that uses the following pattern: [ip, id, user, timestamp,. Server-side errors correspond to HTTP status codes starting with 5 (e.g., 500, 502). Creating a metric filter on the log group using the pattern [ip, id, user, timestamp, request, status_code=5*, size] will capture all such error events across all log streams.
Question
A web application that runs on a fleet of Amazon EC2 instances sends logs to a log group in Amazon CloudWatch Logs. The logs are in the following format: [ip, id, user, timestamp, request, status_code, size]. A developer needs to create a metric filter that will identify all log events that have a status_code value that indicates a server-side error. Which solution will meet this requirement?
Options
- ACreate a metric filter on the log group that uses the following pattern: [ip, id, user, timestamp,
- BCreate metric filter on the log group that uses the following pattern: [ip, id, user, timestamp,
- CCreate metric filter on a log stream that uses the following pattern: [ip, id, user, timestamp,
- DCreate metric filter on a log stream that uses the following pattern: [ip, id, user, timestamp,
How the community answered
(35 responses)- A6% (2)
- B83% (29)
- C3% (1)
- D9% (3)
Explanation
Server-side errors correspond to HTTP status codes starting with 5 (e.g., 500, 502). Creating a metric filter on the log group using the pattern [ip, id, user, timestamp, request, status_code=5*, size] will capture all such error events across all log streams.
Community Discussion
No community discussion yet for this question.