A beginner-friendly Bash script that scans a log file for common failure keywords like error, fail, and timeout, then saves a timestamped report in the reports/ folder.
This tool is ideal for system admins, devs, or anyone learning Bash and log analysis.
- π Scans
.logfiles for critical keywords - π Counts how many times each keyword appears
- π Saves detailed, timestamped reports to
reports/ - π‘ Beginner-friendly and easy to customize
- π§ͺ Sample log file included for testing
β
Output will be saved in the reports/ folder as:
Copy
Edit
report_YYYY-MM-DD_HH-MM-SS.txt
π Repo Structure
perl
Copy
Edit
log-watcher-bash/
β
βββ log-watcher.sh # The main Bash script
βββ sample.log # Sample log file for testing
βββ reports/ # Folder where reports are saved
βββ README.md # Youβre reading it
π§ͺ Sample Output
Copy
Edit
Log Analysis Report - 2025-06-25
----------------------------
error: 3
fail: 1
timeout: 2
π Future Ideas
- Accept log file as argument (./log-watcher.sh mylog.log)
- Add keyword customisation
- Email or Slack alerts for high error count
- Add colored CLI output
π¨πΎβπ» Author
Kepha Sitati
AWS Cloud β’ Bash Scripting β’ Systems Integration