Troubleshooting and Optimization

Application log messages use the format "operation=checkout duration=1250ms" without structured fields. Which CloudWatch Logs Insights query extracts the duration and returns events exceeding 1000 ms?

Show the answer

Correct answerC. parse @message "operation=* duration=*ms" as operation, duration | filter duration > 1000

AWhy not this: There is no automatically discovered @duration field for this custom unstructured message.

BWhy not this: The query extracts duration but aggregates all durations instead of returning only slow events.

CWhy this is right: The parse pattern extracts duration, allowing the filter to select values greater than 1000.

DWhy not this: The text filter matches exactly 1000 ms rather than extracting and comparing larger durations.

The parse command extracts duration from the unstructured message so a numeric filter can select slow events. Matching the literal text duration=1000ms finds that exact value, not durations greater than 1000 ms.