A developer is configuring a custom Amazon CloudWatch metric filter to monitor performance metrics from an API gateway service. The service writes structured JSON logs to a CloudWatch log group. A representative log event has the following structure:
{
"service": "payment-api",
"transaction": {
"success": true,
"amount": 250.00
},
"latency": 150
}
The developer needs to create a metric filter that publishes to a custom metric named `HighValueLatency` in the `PaymentMetrics` namespace. The metric must record the `latency` value, but only for events where the transaction `success` is `true` and the transaction `amount` is strictly greater than .
Which TWO configurations or values must the developer specify in the metric filter settings to achieve this?
- Set the filter pattern to `{ (.transaction.success = true) && (.transaction.amount > 200) }`Answer
- Set the metric value to `$.latency`Answer
- CSet the filter pattern to `{ .transaction.success == true && .transaction.amount > 200 }`
- DSet the metric value to `$latency`
- ESet the filter pattern to `filter transaction.success = true and transaction.amount > 200`