Skip to content

Ali-Hajipour/Log_Analyser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

216 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Log Analyser

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.


Features

  • 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

Project Structure

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
β”‚   └──

About

πŸ” Multi-format log analyser (JSON Β· Apache Β· Syslog) ⚑ Memory-efficient streaming parser πŸ§ͺ 80+ pytest tests 🐍 Python Β· Regex Β· ABC

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages