Skip to main content
ychia
Staff
Staff
Oct 10, 2024 8:52 AM UTC

Technical Tip: Using a CLI command to check the firewall policy creation date and time

  • Oct 9, 2026 6:21 AM UTC
  • 0 replies
  • 4758 views
  • Translate All

Description

 

This article describes how to check the firewall policy creation date and time using a CLI command.

 

Scope

 

FortiGate.

 

Solution

 

SSH into the FortiGate and run the following commands to filter the event logs and display the firewall policy creation event:

 

execute log filter device 0
execute log filter category 1
execute log filter field msg "Add firewall.policy <id>"
execute log display

 

Note: the third command filters the message ('msg') field for the specified string, and the '<id>' value should be changed to the appropriate Firewall Policy ID (or omitted entirely). For example, the following is the result of using the above filters with 'Add firewall.policy 4':

 

d2f917f7.png

 

In the above output, the 'date=' and 'time=' attributes indicate that the Firewall Policy 4 ('abc1010') was created on October 10, 2024, at 13:07:20 in the FortiGate local timezone ('tz="+0800"').

 

Additional notes:

The command execute log filter category supports multiple log categories. The available category values and their corresponding log types are displayed in the following output:

 

79d8c078.png

 

In FortiOS 7.6 and 8.0, event logs can also be filtered by using the named category event. Additional filters, such as subtype or logid followed by the appropriate log ID, can be used to narrow the results when more precise event filtering is required.

 

execute log filter category event
execute log filter field subtype system
execute log filter field logid <logid number>
execute log display

 

For more in-depth information on the available log filters and how to use them with CLI log display, refer to the following Community KB article: Technical Tip: Displaying logs via FortiGate's CLI.

Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024