mardi 27 janvier 2015

How to convert Log file to CSV using bash


Is it possible to turn this log entry into a properly formatted csv file using sed/awk? I've tried multiple ways to do this using sed/awk. Alas I couldn't do it. Before I do it in perl. is this possible in Bash?



Jan 21 11:10:45 hostname.internal.nl THREAT 2015/01/21 11:10:44 critical 5 reset-both outside 10.10.10.10 inside 10.16.61.4 tcp 39898 80 web-browsing any Bash Remote Code Execution Vulnerability(36731)


Like this



Date | Hostname | Threat | DATE+time | Critical/High | Count | --- | External IP | Internal IP | TCP/UDP | Port | External Port| Category | Vulnerability

Jan 21 11:10:45 | hostname.internal.nl | THREAT | 2015/01/21 11:10:44 | critical 5 reset-both | outside 10.10.10.10 | inside 10.16.61.4 | tcp 39898 | 80 | web-browsing | 4any Bash Remote Code Execution Vulnerability(36731)


Aucun commentaire:

Enregistrer un commentaire