marb08 / SnaffledLogs

Simple python script which using some magic allow to parse output generated by Snaffler into a readable and business xslx file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SnaffledLogs ๐Ÿง™โ€โ™‚๏ธ๐Ÿ“

SnaffledLogs is a simple python script which, using some magic, allows to parse output generated by Snaffler into a readable and business xslx file.

Install and Run

git clone https://github.com/marb08/SnaffledLogs.git
cd SnaffledLogs/
pip install -r requirements.txt
python3 SnaffledLogs.py

Usage

  __           _   _                         
 (_  ._   _. _|_ _|_ |  _   _| |   _   _   _ 
 __) | | (_|  |   |  | (/_ (_| |_ (_) (_| _> 
                                       _|                        

usage: SnaffledLogs_beta.py [-h] (-l LOG_FILE | -j JSON_FILE | -d DIRECTORY) [-x FILE_EXTENSION] [-o OUTPUT_FILE]

Parse Snaffler log file(s) and save data to CSV/XLSX.

optional arguments:
  -h, --help            show this help message and exit
  -l LOG_FILE, --log_file LOG_FILE
                        Path to the log file containing the Snaffler logs
  -j JSON_FILE, --json_file JSON_FILE
                        Process the json file containing the Snaffler logs
  -d DIRECTORY, --directory DIRECTORY
                        Process all files containing the Snaffler logs with the specified extension in the current
                        directory
  -x FILE_EXTENSION, --file_extension FILE_EXTENSION
                        File extension to filter files when using -d option
  -o OUTPUT_FILE, --output_file OUTPUT_FILE
                        Output file name

Examples

# Process the logs contained in snaffle_logs.log file
python3 SnaffledLogs.py -l snaffler_logs.log -o output.xlsx

# Process the logs contained inside a json file
python3 SnaffledLogs.py -j snaffler_logs.json -o output.csv

# Process only the files with .log extension in the /home/user/snaffler/logs/ directory
python3 SnaffledLogs.py -d /home/user/snaffler/logs/ -x log -o output.xlsx

Contributing

Pull requests are welcome.

License

This script is licensed under the GNU General Public License v3.0. For more information, please refer to the license text at: https://www.gnu.org/licenses/gpl-3.0.txt

About

Simple python script which using some magic allow to parse output generated by Snaffler into a readable and business xslx file.


Languages

Language:Python 100.0%