A production-grade log analysis tool built in Python. Parses, normalises, and extracts insights from multiple log formats β JSON, Apache Combined Log Format, and Syslog β using a unified, extensible parser architecture.
- Multi-format parsing β JSON, Apache, and Syslog parsers with a shared interface
- Memory-efficient streaming β processes files of any size line by line, constant memory usage
- Level normalisation β maps format-specific level names to a standard set (
INFO,WARN,ERROR,CRITICAL) - Graceful error handling β malformed lines are skipped and counted, never crash the program
- Extensible architecture β add new formats by implementing one method (
parse_line) - Fully tested β 80+ tests across all parsers using pytest
log_analyser/
βββ parsers/
β βββ base.py # Abstract base class β shared interface for all parsers
β βββ json_parser.py # JSON log parser (supports multiple field aliases)
β βββ apache_parser.py # Apache Combined Log Format parser
β βββ syslog_parser.py # Syslog format parser with keyword-based level detection
βββ tests/
β βββ test_json_parser.py
β βββ test_apache_parser.py
β βββ