Answer
Raw grep finds lines but doesn't summarize, so for triage you compose tools: grep 'Exception' app.log | grep -oP '\w+Exception' | sort | uniq -c | sort -rn ranks which exception types dominate, and grep -c ERROR scoped to the current hour gives an error rate. set -o pipefail in scripts ensures a failing stage in a pipe doesn't get masked by a successful tail. The senior framing is treating logs as a data stream you aggregate (counts, top-N, time-window) rather than eyeballing, which turns 'something's wrong' into 'NullPointerException is 80% of errors and started at 14:32.'
Common mistakes
- Grepping huge logs without filtering by time window.
- Not using awk, sort and uniq -c to count patterns.