nerdexam
Amazon

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

Submitted by femi9· Mar 6, 2026Monitoring and Logging

Question

A company has an application that uploads access logs to an Amazon CloudWatch Logs log group. The fields in the log lines include the response code and the application name. The company wants to create a CloudWatch metric to track the number of requests by response code in a specific range and with a specific application name. Which solution will meet these requirements?

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

#CloudWatch Logs#Metric filters#Logging#Monitoring

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice