Examples of custom datasets
Examples of custom datasets
The following examples illustrate how to write custom datasets.
After you create the datasets, you can use them when you configure chart templates under Reports>Report Definitions
>Chart Library. Configured charts can be selected when creating or modifying reports.
For more information on creating charts and reports, see the FortiAnalyzer Administration Guide.
Example 1: Packets denied by UTM for a source or destination matching '172.30.xx.xx':
1. Go to Reports>Report Definitions >Datasets, and click Create New.
2. Enter a name for the dataset, for example:packet_denied_by_UTM_or_dest.
3. Under Log Type, select Traffic.
4. Configure Time Period and Devices.
5. Under Query, enter the following:
select vd, srcip, dstip, srcport, dstport, srcintf, dstintf, service, msg, count(*) as
totalnum
from $log
where $filter and utmaction='block' and (ipstr(srcip) like '172.30%' or ipstr(dstip)
like '172.30%')
group by srcip, dstip, srcport, dstport, srcintf, dstintf, vd, service, msg
order by totalnum desc
Example 2: Top 10 hosts that had the most packets dropped with error message 'no session matched' or
'replay packet(allow_err), drop':
1. Go to Reports>Report Definitions >Datasets, and click Create New.
2. Enter a name for the dataset, for example:top_10_packet_dropped_with_error.
3. Under Log Type, select Traffic.
4. Configure Time Period and Devices.
FortiAnalyzer 7.0.0 SQL Log DatabaseQuery 15
Fortinet Inc.