Convert Fortinet’s Fortiguard WebFilter logs to CSV Format

I put together this script called csvify_fortinet_logs in order to convert the space separated format of Fortinet Router’s Fortiguard WebFilterLog to a more widely used and favorable for analysis format, CSV. I wanted to analyse the web filter log of the router, but could not use it as an input to pandas, so had to code this.

What the script does is, convert the log from following transaction format:

To CSV:

CSV Format

 

It’s made using Python, and needs numpy and pandas library.

The code should be pretty self explanatory (and there’s comments too!).  I used pandas to combine the CSVs because I am using it for analysis pretty often, but there could be a better way to do it.

You can download the script from Github.

PS. I’m creating posts for each of my Github repos / projects so that its more reachable for people from Google Search.

3 Responses

  1. anoymous July 22, 2018 / 8:39 pm

    Hi,

    May I know how do you point the script to the fortinet log file?

    • Subigya Nepal August 1, 2018 / 10:45 pm

      Any and all fortinet log files with “.log” extension inside the current directory (i.e. the directory where the script is ran from) will be converted to CSV.

Leave a Reply

Your email address will not be published. Required fields are marked *