Skip to content

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.

Notifications You must be signed in to change notification settings

kephasitati/log-watcher-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” log-watcher.sh

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.


πŸš€ Features

  • πŸ”Ž Scans .log files 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

🧰 How to Use

βœ… 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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages