Soru

Zorluk: ZorCloudWatch Logs and Metric Filters

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 10001000 milliseconds. The captured latency values must be published to a custom CloudWatch metric.

Which configuration should the administrator use to accomplish this?

  1. 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
  2. B
    Create a metric filter with the filter pattern `[date, time, transaction_id, status = SUCCESS, latency > 1000]` and set the metric value to `latencyinthemetrictransformation,thenenabledetailedmonitoringontheAmazonEC2instancestoensurethecustommetricreportsatlatency` in the metric transformation, then enable detailed monitoring on the Amazon EC2 instances to ensure the custom metric reports at 1$-minute intervals.
  3. C
    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, then set the log group retention period to Never Expire to prevent CloudWatch from deleting log data before the custom metric is published.
  4. D
    Configure 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

1
Define the filter pattern for space-delimited logs.
The pattern `[date, time, transaction_id, status = SUCCESS, latency > 1000]` maps the fields in order and filters for status equal to SUCCESS and latency greater than 10001000.
This matches the space-delimited format of the incoming logs and applies the required filtering criteria.
2
Configure the metric value in the metric transformation.
Set the metric value to `$latency`.
This extracts the actual value of the fifth field (latency) from the log event to publish it as the metric data point, rather than just counting the occurrences.

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.
Bu soruyu puanla