A developer is monitoring a payment processing application deployed on Amazon EC2. The Unified CloudWatch Agent is configured to stream application logs to a CloudWatch Logs log group named `/aws/ec2/PaymentService`. The application outputs logs in the following JSON format:
{
"timestamp": "2026-07-14T12:00:00Z",
"status": "FAILED",
"executionTimeMs": 4500,
"errorDetails": {
"category": "GatewayTimeout",
"attempt": 3
}
}
The developer needs to create a CloudWatch Alarm that triggers when there are more than 5 occurrences of failed executions due to a `GatewayTimeout` where the number of attempts is greater than 2 within a 5-minute window.
Which of the following actions should the developer take to implement this monitoring solution? (Select TWO.)
- Create a CloudWatch Logs metric filter on the `/aws/ec2/PaymentService` log group with the filter pattern `{ .status = "FAILED" && .errorDetails.category = "GatewayTimeout" && $.errorDetails.attempt > 2 }`.Cevap
- BCreate a CloudWatch Logs metric filter on the `/aws/ec2/PaymentService` log group with the space-delimited filter pattern `[timestamp, status = "FAILED", executionTimeMs, category = "GatewayTimeout", attempt > 2]`.
- Create a CloudWatch Alarm that monitors the custom metric generated by the metric filter, configuring it to trigger when the metric value is greater than 5 within an evaluation period of 5 minutes.Cevap
- DCreate a CloudWatch Logs subscription filter with a destination of Amazon EventBridge, and configure an EventBridge rule to match the error patterns and route them to an alarm.
- EConfigure the Unified CloudWatch Agent configuration file (`amazon-cloudwatch-agent.json`) on the EC2 instances with a custom metric parsing rule to extract the JSON properties and publish them directly to CloudWatch Metrics.