Question

Difficulty: MediumCloudWatch Logs and Metric Filters

An operations team is monitoring a containerized reporting service that writes space-delimited logs to an Amazon CloudWatch Logs group. The log entries follow this format:

`[log_level, timestamp, job_id, duration, memory_mb]`

An example log entry is:

`INFO 2026-07-14T12:00:00Z job-8829 45.2 12500`

A SysOps Administrator needs to create a metric filter to track executions where the job duration is strictly greater than 30.030.0 seconds and the memory usage is greater than or equal to 8,0008,000 MB.

Which TWO configurations must the administrator implement to meet these requirements?

  1. Define a metric filter pattern of `[log_level, timestamp, job_id, duration > 30.0, memory_mb >= 8000]` on the log group.Answer
  2. Configure a metric transformation that increments the custom metric count by 11 whenever a matching log event is detected.Answer
  3. C
    Enable CloudWatch detailed monitoring on the underlying compute instances to speed up log ingestion and metric filter execution.
  4. D
    Set the log retention period in the metric filter configuration to expire logs immediately after metric extraction to save storage costs.
  5. E
    Configure an Amazon EventBridge rule with an event pattern matching `[duration > 30.0, memory_mb >= 8000]` to intercept the log stream before it reaches the log group.

Answer

Configure a metric filter pattern of `[log_level, timestamp, job_id, duration > 30.0, memory_mb >= 8000]` and define a metric transformation that increments the custom metric count by 11 for each matching log event.
The correct options implement a space-delimited metric filter pattern that maps exactly to the fields in the log line and applies the correct comparison operators. The metric transformation must increment the metric by 11 to aggregate occurrences.

Step-by-Step Solution

1
Analyze the log format and requirements.
The logs are space-delimited and contain five fields: log_level, timestamp, job_id, duration, and memory_mb.
This determines the structure of the space-delimited metric filter pattern.
2
Construct the metric filter pattern.
The correct pattern syntax is `[log_level, timestamp, job_id, duration > 30.0, memory_mb >= 8000]`.
This targets the fourth field (duration) with a strict inequality (>30.0> 30.0) and the fifth field (memory_mb) with a greater-than-or-equal inequality (8000\geq 8000).
3
Configure the metric transformation.
The metric value is set to 11 to count each occurrence of matching log entries.
This allows CloudWatch to increment the metric value by 11 every time a matching log line is ingested.

Key Concept

Amazon CloudWatch Logs Metric Filters can parse space-delimited log messages to extract metrics based on field values, which can then be used to trigger alarms.
Rate this question