Skip to content

Python CLI tool to parse, filter, and summarize log files with CSV export and color-coded terminal output.

Notifications You must be signed in to change notification settings

mhmmds7313/log-file-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

# Log File Analyzer

A Python CLI tool to analyze log files, filter logs by date range, and generate summary reports in CSV format.

## Features

- Parse structured log files
- Filter logs between any two dates/times
- Count log entries by severity level (INFO, WARNING, ERROR)
- Export summary reports as CSV files
- Color-coded terminal output for easier readability

## Requirements

- Python 3.6+
- colorama (`pip3 install colorama`)

## Usage

```bash
python3 log_analyzer.py <logfile> "<start_date>" "<end_date>" [--output <output_csv>]


Example

python3 log_analyzer.py sample.log "2025-06-03 12:31:00" "2025-06-03 12:34:00" --output filtered_report.csv


Sample Output

INFO: 1
WARNING: 1
ERROR: 1
Report saved to filtered_report.csv


How It Works

Reads and parses the log file
Filters logs within the specified date range
Counts log entries by their level
Displays a color-coded summary in the terminal
Saves the summary as a CSV report


👤 Author

Mohammad Akib Shaikh
Aspiring Cybersecurity Analyst • Security+ Candidate

About

Python CLI tool to parse, filter, and summarize log files with CSV export and color-coded terminal output.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages