Troubleshooting and Optimization

Which CloudWatch Logs Insights command restricts query results to events whose requestId field matches a specified value?

Show the answer

Correct answerC. filter

AWhy not this: The fields command selects or derives fields rather than restricting events by requestId.

BWhy not this: The stats command calculates aggregates rather than selecting events by a matching field value.

CWhy this is right: The filter command retains events that satisfy the specified requestId condition.

DWhy not this: The sort command orders results without selecting events by a matching field value.

The filter command selects events that satisfy a condition, such as an exact requestId match. The fields command selects fields to display or creates derived fields; it does not by itself restrict events to a matching request.