An engineer must find the 20 most frequent error messages across millions of Lambda log lines from the last 24 hours. What is the quickest way?
- Exam domain
- Data Operations and Support22% of the exam
- Difficulty
- Easy
- In this mock
- 21 questions on this domainPractise this domain
Why the exam asks this
Task Statement 3.3: Maintain and monitor data pipelines.
Objective in the exam guide: Analyze logs with AWS services (for example, Athena, Amazon EMR, Amazon OpenSearch Service, CloudWatch Logs Insights).
Logs grow beyond what anyone can read by hand. Query tools turn them into answers during incidents and audits.
Why C is the answer
Run a CloudWatch Logs Insights query that filters errors and counts by message
CloudWatch Logs Insights queries large log volumes with filtering and aggregation in seconds.
Remember: Analyze logs at scale with a query language, such as CloudWatch Logs Insights.
How it works
CloudWatch Logs Insights runs queries over log groups, with filtering, parsing and aggregation.
A query can filter error lines, group by message and sort by count, across millions of lines.
For logs stored in S3, Athena offers SQL; OpenSearch Service suits search and dashboards.
Clues in the question
The words that point to the answer, and what each one tells you.
- Millions of Lambda log lines
- Too many to read; query them.
- Most frequent error messages
- Filter, group and count.
In detail
- Athena and OpenSearch Service can also analyze logs stored in S3 or indexed for search.
- Saved queries make repeat analysis quick.
Side by side with look-alikes
| Tool | Best for |
|---|---|
| CloudWatch Logs Insights | Logs in CloudWatch |
| Athena | Logs in S3 |
| OpenSearch Service | Search and dashboards |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Open each log stream in the console one by oneWrongMost tempting
Clicking through streams does not scale.
Why it tempts: It works for a single invocation. But it cannot summarize millions of lines.
B. Ask users which errors they sawWrong
Users see only some errors, later.
C. Run a CloudWatch Logs Insights query that filters errors and counts by messageRight
Analyze logs at scale with a query language, such as CloudWatch Logs Insights.
D. Download every log file and search it by handWrong
Manual downloads are slow at this volume.
In practice
- Save common queries and add them to dashboards.
Use case
An illustrative scenario, not a real incident.
One Logs Insights query shows a timeout message is 70% of all errors, so the team fixes that first.
See how it works
xychart-beta x-axis ["Timeout", "Throttled", "Bad input", "Auth failed"] y-axis "Count" 0 --> 8000 bar [7200, 1800, 900, 300]
How to read this chart
- Each bar is one error message, counted across all the logs.
- Timeouts dominate, so fixing them removes most errors.
- A single query produced this, instead of reading millions of lines.