A SysOps administrator is configuring a monitoring solution for a legacy transaction-processing application. The application logs are streamed to an Amazon CloudWatch Logs log group. The log events use a space-delimited format, with each line structured as:
`[Date] [Time] [Transaction_ID] [Status] [Latency_MS]`
An example log line is:
`2026-07-14 10:15:30 tx-40293 SUCCESS 1250`
The administrator needs to monitor performance degradation by capturing the latency of all successful transactions where the latency exceeds milliseconds. The captured latency values must be published to a custom CloudWatch metric.
Which configuration should the administrator use to accomplish this?
- Create a metric filter with the filter pattern `[date, time, transaction_id, status = SUCCESS, latency > 1000]` and set the metric value to `$latency` in the metric transformation.Cevap
- BCreate a metric filter with the filter pattern `[date, time, transaction_id, status = SUCCESS, latency > 1000]` and set the metric value to ` 1$-minute intervals.
- CCreate a metric filter with the filter pattern `[date, time, transaction_id, status = SUCCESS, latency > 1000]` and set the metric value to `$latency` in the metric transformation, then set the log group retention period to Never Expire to prevent CloudWatch from deleting log data before the custom metric is published.
- DConfigure an Amazon EventBridge rule to match any incoming log event containing the SUCCESS status, and set the target to an AWS Systems Manager Automation document that parses the log line and publishes the metric.
Cevap
Create a metric filter with the filter pattern `[date, time, transaction_id, status = SUCCESS, latency > 1000]` and set the metric value to `$latency` in the metric transformation.
The correct option specifies a valid space-delimited filter pattern `[date, time, transaction_id, status = SUCCESS, latency > 1000]` and maps the value of the fifth field using `$latency` in the metric transformation. This correctly extracts the numeric latency value and publishes it to CloudWatch Metrics.
Adım Adım Çözüm
Anahtar Kavram
CloudWatch Logs Metric Filters allow administrators to use space-delimited or JSON patterns to search log streams and extract terms or values to publish as custom metrics in CloudWatch.