An application runs on EC2 instances and streams its access logs to an Amazon CloudWatch Logs group. The logs are formatted as space-delimited text lines representing the timestamp, client IP address, request path, HTTP status code, and latency in milliseconds. Below is an example log event:
`1719264000 192.0.2.10 /orders/create 504 3500`
A SysOps administrator needs to set up an alarm to alert the operations team when requests to `/orders/create` experience a gateway timeout () and take more than to complete. Which two actions should the administrator perform to configure this monitoring and alarm solution? (Select two.)
- Create a CloudWatch metric filter on the log group using the filter pattern `[timestamp, client_ip, request_path = "/orders/create", status_code = 504, latency > 3000]`, and set the metric value to .Cevap
- Create a CloudWatch alarm associated with the custom metric generated by the metric filter, defining the threshold to trigger when the count exceeds the acceptable limit.Cevap
- CEnable Detailed Monitoring on the EC2 instances hosting the application to ensure that the log-derived custom metric is evaluated at intervals.
- DConfigure the log group retention period to day to ensure that log events are processed by the custom metric filter at a faster ingestion rate.
- ECreate an Amazon EventBridge rule that directly parses the space-delimited log patterns from the log stream and triggers an AWS Systems Manager Automation runbook to increment the custom metric.
Cevap
To implement the monitoring and alarm solution, the administrator must create a CloudWatch metric filter using the space-delimited positional pattern `[timestamp, client_ip, request_path = "/orders/create", status_code = 504, latency > 3000]` with a metric value of , and then create a CloudWatch alarm that monitors this custom metric and triggers when the threshold is exceeded.
The correct approach requires first extracting the relevant metric from the space-delimited log events using a CloudWatch Logs metric filter with the correct positional syntax and a metric value of . After the custom metric is published, a CloudWatch alarm must be configured to monitor the custom metric and trigger notifications when the threshold is exceeded.
Adım Adım Çözüm
Anahtar Kavram
Creating metric filters on space-delimited CloudWatch Logs and configuring alarms based on the resulting custom metrics.
Tahmini Süre:2m 0s