•Arnošt Havelka
Premium: Bash Log Hunt
Hunt deployment failures fast with grep pipelines, counts, and saved incident notes.
Start Interactive LessonWhen incidents hit, speed matters. This drill teaches a repeatable grep workflow for mixed-case errors.
Pipeline Pattern
Try the command
Which command stores the fail count?
Build the command
cat deploy.log | grep -i 'fail' | wc -l > fail-count.txt
grep -iMatch fail/FAIL/Fail in one pass.
wc -lCount matching lines.
>Save count to a report file.
Terminal
C:\Users\User>cat deploy.log | grep -i 'fail' | wc -l > fail-count.txt
Step 1: Confirm Error Signal
Command Prompt
INFO deploy started
WARN retrying worker
FAIL api timeout
info finished stage
fail db reconnect
C:\Users\User>cat deploy.log
Step 2: Save Count for the Timeline
Command Prompt
C:\Users\User>cat fail-count.txt
Step 3: Slice by Incident Theme
Use extra filters to split failures by symptom:
grep -i 'timeout' deploy.log > timeout-errors.loggrep -i 'db' deploy.log > db-errors.log
Knowledge Check
1 / 2Why use grep -i during incident triage?
References
These documentation links provide authoritative details for the commands used in this article.