Skip to main content
MORAMADAN
Explorer III
June 5, 2023
Question

Export forwarded logs in csv format

  • June 5, 2023
  • 11 replies
  • 11236 views

Hello Bro,

              I have been trying to export "forwarded logs" in a csv format for filtration process but still don't know how? any ideas?

knowung that, fortigate software version 7.0.11, and no fortianalyzer

TIA

11 replies

srajeswaran
Staff
Staff
June 6, 2023

While downloading the log file, save it as .csv file. Then we can try using "Text to Columns" option available on excel to move the data to separate columns. Use "space" as delimiter.

 

Ref: https://support.microsoft.com/en-us/office/split-text-into-different-columns-with-the-convert-text-to-columns-wizard-30b14928-5550-41f5-97ca-7a3e9c363ed7

MORAMADAN
MORAMADANAuthor
Explorer III
June 7, 2023

Hi Sraj,

          Thank you so much for your assistance, I have tried the MS excel text to data methde but it was not as expected since the downloaded logs are not equally when using spaces as a separator, ie... filds are not well suitable for beingseparated by spaces.

If any more ideas will be appreciated,

srajeswaran
Staff
Staff
June 7, 2023

I am not sure if there is a better way. Is there any specific filters that you are not able to apply directly on fortigate?

Faiza_Emam_Delhi
Visitor III
June 8, 2023

To export forwarded logs in a CSV format on a FortiGate device running FortiOS 7.0.11, you can follow these steps:

1. Log in to the FortiGate device web interface.

2. Go to Log & Report > Log Settings > Forwarding.

3. Click the Export button at the top of the page.

4. Select the log type that you want to export (e.g., Traffic, Event, etc.).

5. Set the date range for the logs that you want to export.

6. Set the format to CSV.

7. Click the Download button to download the exported logs in a CSV format.

With these steps, you should be able to export forwarded logs in a CSV format on your FortiGate device. Note that the exported logs may be limited to a certain number of records, depending on the device's settings. If you need to export a larger number of records, you may want to consider using a FortiAnalyzer device or another log management solution.

MORAMADAN
MORAMADANAuthor
Explorer III
June 8, 2023

Hello Emam,

                   Thank you for your assistance but no "Forwarding --> Export button at the top of the screen".

 
 

 

MORAMADAN
MORAMADANAuthor
Explorer III
June 8, 2023

Screenshot 2023-06-08 124043.png

srajeswaran
Staff
Staff
June 12, 2023

Hi Ramadan,

 

Can you try this python script? I tested it few times and it worked for me.
You just need to change the input file name to your file "exported from fortigate traffic log" section.

# Example usage
input_file = 'disk-traffic-local-2023_06_06.log'
output_file = 'output2.xlsx'

MORAMADAN
MORAMADANAuthor
Explorer III
June 20, 2023

Hello Suraj,

              Thank you so much for the response, and I am trying it and back yo you with the result Bro.

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!