DOP-C02 · Question #331
DOP-C02 Question #331: Real Exam Question with Answer & Explanation
The correct answer is B. Create a CloudWatch Logs metric filter on the CloudWatch Logs log group to match the response. A CloudWatch Logs metric filter allows you to search for specific patterns (such as a range of response codes) in your log data and generate CloudWatch metrics based on those patterns. By creating a metric filter on the CloudWatch Logs log group, you can extract relevant log entr
Question
Options
- ACreate a CloudWatch Logs log event filter on the CloudWatch Logs log stream to match the
- BCreate a CloudWatch Logs metric filter on the CloudWatch Logs log group to match the response
- CCreate a CloudWatch Contributor Insights rule on the CloudWatch Logs log stream with a filter to
- DCreate a CloudWatch Logs Insights query on the CloudWatch Logs log group to match the
Explanation
A CloudWatch Logs metric filter allows you to search for specific patterns (such as a range of response codes) in your log data and generate CloudWatch metrics based on those patterns. By creating a metric filter on the CloudWatch Logs log group, you can extract relevant log entries (like response codes and application names) and turn them into CloudWatch metrics. When setting up the metric filter, you can specify dimensions for the metric, such as the response code and application name. These dimensions enable you to filter and segment the data when visualizing or alerting on the metric. Using a metric filter is the most direct and efficient way to count specific log events (e.g., requests by response code) and automatically convert them into CloudWatch metrics. This approach provides a continuous and near-real-time stream of data from the logs to CloudWatch metrics. By using CloudWatch Logs metric filters, you can track the number of requests based on response code and application name efficiently, automatically incrementing the metrics whenever a log matches the defined pattern. This provides a streamlined and operationally efficient way to monitor the application.
Topics
Community Discussion
No community discussion yet for this question.