During an incident, an engineer must find which error codes appeared most often in the last hour across the log groups of 12 microservices. The services write JSON logs with an errorCode field, and nothing has been set up beforehand. Which approach gives the answer fastest?
Show the answer
Correct answerD. Run one CloudWatch Logs Insights query across the 12 log groups using stats count(*) by errorCode.
AWhy not this: Metric filters only count events ingested after the filter exists, so they cannot report the past hour.
BWhy not this: Contributor Insights rules evaluate log events as they arrive after the rule is created, not the past hour.
CWhy not this: Subscription filters forward only new events and require building and loading a separate cluster.
DWhy this is right: One query over existing events in all 12 log groups can count and sort error codes from the past hour right away.
Logs Insights queries log events already stored, across several log groups at once, and discovers JSON fields automatically, so stats count(*) by errorCode gives the counts for the past hour immediately. Metric filters, Contributor Insights rules, and subscription filters only process events that arrive after they are created.