Lightweight CLI-Based Log Analytics & Statistical Anomaly Detection System for DevOps and SRE environments.
LogSentinel is a shell-based log analytics tool designed to perform statistical anomaly detection using Z-score methodology.
It is built to simulate production-ready log monitoring logic in lightweight environments and CI/CD pipelines.
The project demonstrates:
- CLI engineering
- Statistical anomaly detection
- Automation readiness
- CI/CD integration capability
- Containerized execution
- DevOps-oriented system thinking
- Argument-driven log input
- Statistical anomaly detection (Z-score)
- Configurable threshold
- Structured output (JSON/Text)
- Proper exit codes for CI/CD
- Docker support
- GitHub Actions integration
- Alert-ready architecture
Basic log parsing and error counting.
Error summaries and log classification.
Statistical anomaly detection using Z-score (mean and standard deviation).
Production-ready CLI tool:
- Argument parsing
- Configurable thresholds
- Structured output
- Exit codes
- Robust error handling
DevOps integration:
- Docker containerization
- GitHub Actions CI pipeline
- Pipeline failure on anomaly detection
Monitoring integration:
- Prometheus-style metrics output
- Slack webhook alert support
- Time-window based anomaly detection
Anomalies are detected using Z-score:
Z = (X - Mean) / StandardDeviation
Default threshold: 2 (Threshold is configurable via CLI flag.)
This allows detection of abnormal log behavior based on deviation from baseline error rates.
Clone repository:
git clone https://github.com/yourusername/logsentinel.git
cd logsentinel
chmod +x logsentinel.shBasic usage:
./logsentinel.sh --file /var/log/nginx/access.logCustom threshold:
./logsentinel.sh --file app.log --threshold 3JSON output:
./logsentinel.sh --file app.log --format jsonExit Codes:
- 0 → No anomaly
- 1 → Anomaly detected
- 2 → Invalid input
Fail pipeline on anomaly:
./logsentinel.sh --file app.log
if [ $? -eq 1 ]; then
exit 1
fiBuild:
docker build -t logsentinel .Run:
docker run -v $(pwd)/logs:/logs logsentinel --file /logs/app.log- Small teams without enterprise monitoring tools
- CI/CD anomaly detection
- Pre-production log validation
- Security log spike detection
- Lightweight DevOps observability simulation
This project demonstrates applied DevOps engineering practices including:
- Statistical reasoning in operations
- CLI tool design
- Production thinking
- CI/CD pipeline integration
- Containerized deployment
- Automation-first architecture