A Python script that parses .log and .txt files in a given directory and exports the results into a CSV file.
This makes it easier to investigate logs with tools like Excel or SIEMs.
- Parses all
.logand.txtfiles in a directory. - Extracts:
- Timestamp
- Log level (INFO, ERROR, WARNING, etc.)
- Message
- IP addresses
- Status values
- Saves results into
parsed_logs.csv.
git clone https://github.com/codedByJana/LogFileParsingTool.git cd LogFileParsingTool
python logParsingTool.py <directory-path>
python logParsingTool.py "C:\Users\dell\logs"
06/12 14:23:45 INFO: User logged in from 192.168.1.1 status: success
06/12 14:25:10 ERROR: Connection failed from 10.0.0.5 status: failed
| timestamp | ip | status |
|---|---|---|
| 06/12 14:23:45 | 192.168.1.1 | success |
| 06/12 14:25:10 | 10.0.0.5 | failed |
Python 3.x
- Add more log format support
- Add filtering options
- Support JSON output