Skip to content

codedByJana/LogFileParsingTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Log File Parsing Tool

What's That?

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.

Features

  • Parses all .log and .txt files in a directory.
  • Extracts:
    • Timestamp
    • Log level (INFO, ERROR, WARNING, etc.)
    • Message
    • IP addresses
    • Status values
  • Saves results into parsed_logs.csv.

Usage

Clone the repository

git clone https://github.com/codedByJana/LogFileParsingTool.git cd LogFileParsingTool

Run The Script

python logParsingTool.py <directory-path>

Example

python logParsingTool.py "C:\Users\dell\logs"

Example Log

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

CSV Output

timestamp ip status
06/12 14:23:45 192.168.1.1 success
06/12 14:25:10 10.0.0.5 failed
Requirements

Python 3.x

Standard libraries: os, glob, re, csv, argparse

Future Work

  • Add more log format support
  • Add filtering options
  • Support JSON output

About

Log file parsing tool in python using re, os, csv, argparse, glob library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages