FortiAnalyzer
FortiAnalyzer can receive logs and Windows host events directly from endpoints connected to EMS, and you can use FortiAnalyzer to analyze the logs and run reports.
farhanahmed
Staff
Staff
Article Id 316140
Description The article describes how to create a FortiAnalyzer report for policy hit count.
Scope FortiAnalyzer, FortiGate.
Solution

Under Log View -> Reports -> Report Definitions -> Datasets -> Create the following SQL dataset, with Log Type: Traffic, that will be used to generate a report:

 

SELECT policyid,

   count (*) AS policyhit

FROM $log

   WHERE $filter

GROUP BY

   policyid

ORDER BY

   policyhit desc

 

This will count all policies hit and order by policies with the highest hit count.

To sort by policy ID the the last line can be modified to:

ORDER BY

   policyid asc

 

Use the dataset above in a Chart or a Macro and then in a Report:

Creating charts

Creating macros

Creating reports without using a template

 

Result (sorted by policyhit): 

policy_hit.png

 

A filter in report settings can be added to count only for a specific policy ID: Filtering report output.

 

Note:

From v7.4.0 and above, the hit-count column in the firewall policy firmware version is removed.

 

Related articles:
Technical Tip: How to create FortiAnalyzer reports using custom SQL queries.

Technical Tip: How to check the Hit Count, First hit, last hit, and established session count for si...