Skip to main content
aahmadbasri
Staff
Staff
August 13, 2024

Technical Tip: Add a custom field in FortiGate logs

  • August 13, 2024
  • 0 replies
  • 2322 views
Description This article describes how to add a custom field in FortiGate logs.
Scope FortiGate, Logs.
Solution

If a specific field  is necessary in FortiGate logs (for example, for logs classification in the Syslog server), the custom field can be added:

 

  1. Configure a custom field with a value :

 

config log custom-field
    edit "CustomLog"        
        set name "Class"            <----- Field Name.
        set value "FortiGate-VM"    <----- Field Value.
    next
end

 

  1. Configure the log setting:

 

config log setting

    set custom-log-fields "CustomLog"

end

 

All logs in FortiGate will be added with the custom field.  Sample Forward Traffic logs:

 

KB_9_1.png

 

Sample System Event Logs:

 

KB_9_2.png

 

Logs sent to the syslog server will include this custom field. 

 

Note:

Changing log field names directly on a FortiGate or FortiGate VM is not supported, as FortiOS relies on a predefined logging structure. The field names are standardized and cannot be modified within the device.

 

 

    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!