FortiGate: which logs get sent (policy logging and filters)
When to use this: The syslog server receives only some logs, or too many, and you want to control what the FortiGate generates and sends.
Before you start
Steps
-
Control traffic logging per firewall policy
terminalconfig firewall policy edit 1 set logtraffic all next endReplace
1with the policy ID.alllogs every session,utmlogs only sessions that trigger security profiles,disablelogs none. Without this, the firewall may generate no traffic logs for that policy at all. -
Review what a policy currently does
terminalshow firewall policy 1Look for
set logtrafficin the output. A policy that has no line may be using a different default for your version. -
Optionally limit what is forwarded by severity
terminalconfig log syslogd filter set severity information endForwards messages at that severity and more serious ones. Use
set severity ?to see the allowed levels. This setting lives under the syslog filter, separate from the destination server. -
Check the volume afterwards
After a day, check the growth of the server's folder for this device (
du -sh). Adjust policy logging or filters if the volume is higher than your disk plan.
How to verify it worked
- Traffic through the policy generates log lines on the syslog server, and the chosen severity levels appear.
How to undo it
Return a policy to utm-only logging:
config firewall policy
edit 1
set logtraffic utm
next
endCommon errors and fixes
logtraffic on the policies you care about. logtraffic all on busy policies, especially internet access. Log only the policies that matter or use utm, and size the disk accordingly. ? after config log syslogd to list the available sub-commands. Q&A
Why do I get no traffic logs even though syslog works?
Syslog only forwards what is generated. Enable traffic logging on the policies.
What does logtraffic utm do?
Logs only sessions that match security profile inspection. all logs every session, which is much more data.