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 seconds and the memory usage is greater than or equal to MB.
Which TWO configurations must the administrator implement to meet these requirements?
- Define a metric filter pattern of `[log_level, timestamp, job_id, duration > 30.0, memory_mb >= 8000]` on the log group.Answer
- Configure a metric transformation that increments the custom metric count by whenever a matching log event is detected.Answer
- CEnable CloudWatch detailed monitoring on the underlying compute instances to speed up log ingestion and metric filter execution.
- DSet the log retention period in the metric filter configuration to expire logs immediately after metric extraction to save storage costs.
- EConfigure 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 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 to aggregate occurrences.
Step-by-Step Solution
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.