A developer is troubleshooting an application that writes space-delimited log events to an Amazon CloudWatch Logs log group. A sample log event is:
`2026-07-14T12:00:00Z INFO 192.168.1.50 GET /index.html 200 125`
The fields in the log event represent the timestamp, severity, client IP address, HTTP method, resource path, status code, and response time in milliseconds, in that order.
The developer wants to create a CloudWatch Logs metric filter that counts all requests where either the status code is or the response time is greater than .
Which of the following filter patterns must the developer use to correctly implement this metric filter?
- A[timestamp, severity, client_ip, method, resource, status_code = 500 OR response_time_ms > 500]
- B{ .response_time_ms > 500 }
- [timestamp, severity, client_ip, method, resource, status_code = 500 || response_time_ms > 500]Cevap
- Dfields status_code, response_time_ms | filter status_code = 500 or response_time_ms > 500
Cevap
The filter pattern starting with square brackets and using the double pipe operator '||' to combine the field conditions.
The correct answer defines the space-delimited fields sequentially inside square brackets, assigning names to each position. It uses the correct logical OR operator '||' to combine the conditions for the status code and response time fields.
Adım Adım Çözüm
Anahtar Kavram
CloudWatch Logs metric filter pattern syntax for space-delimited logs.
Tahmini Süre:1m 30s