Created
October 19, 2019 23:23
-
-
Save leegin/cfe92cc7fead87663be9187f0a5fdf57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
#Script to parse the logs and then convert it to json | |
read -p ('Enter the name of the log file which you want to parse:') file | |
jq -Rs '[ split("\n")[] | select(length > 0) | split(",") | {type: .[0], date: .[1], source_ip: .[2], response_time: .[3], target_url: .[4], http_code: .[5]}]' $file > output.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment