FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
tonylin1
Staff
Staff
Article Id 418613
Description This article explains how to troubleshoot the FortiView database.
Scope FortiGate v7.x and above.
Solution

Open debug:

 

diagnose debug application miglogd 0x71000

diagnose debug enable

 

CLI command for troubleshooting FortiView:

Set up a time range for the query:

 

diagnose fortiview time "2025-11-12 08:00:00" "2025-11-12 09:00:00"

 

Check time range settings:

 

diagnose fortiview time

Current start:2025-11-12 08:00:00 end:2025-11-12 09:00:00 . Now:2025-11-12 09:48:17

 

Query FortiView source from backend and check the debug from miglogd and result:

 

   diagnose fortiview source

Request:source, Device:disk, View:group, Top:600, 

Start:2025-11-12 08:00:00, End:2025-11-12 09:00:00

fortiview_request_data()-851: dataset:fv.source.group tabid:0

_dump_sql()-779: dataset=fv.source.group

 

_dump_sql()-781: temp_sql: create temp table tb as SELECT srcip,user,unauthuser,devtype,srcmac,srcintf,fctuid,passthrough, sum(sessioncount) sessioncount,sum(rcvdbyte) rcvdbyte,sum(sentbyte) sentbyte,sum(crscore) crscore,sum(browsingtime) browsingtime  from grp_traffic_all where  timestamp BETWEEN 1762905600 and 1762909200  and 1=1 group by srcip,user,unauthuser,devtype,srcmac,srcintf,fctuid,passthrough

10(ms)

 

_dump_sql()-783: sql:select srcip, ft_firstitem(group_concat(distinct ifnull(user, unauthuser))),ft_firstitem(group_concat(distinct devtype)),ft_firstitem(group_concat(distinct srcmac)),ft_firstitem(group_concat(distinct srcintf)),ft_firstitem(group_concat(distinct unauthuser)),ft_firstitem(group_concat(distinct fctuid)),sum(sessioncount) session_count, sum(case when passthrough<>'block' then sessioncount else 0 end) session_allow, sum(case when passthrough='block' then sessioncount else 0 end) session_block, sum(rcvdbyte) r, sum(sentbyte) s, sum(rcvdbyte + sentbyte) bandwidth ,sum(crscore) score, sum(case when passthrough<>'block' then crscore else 0 end) score_allow, sum(case when passthrough='block' then crscore else 0 end) score_block  from tb group by srcip  order by bandwidth desc  limit 600; agggr:0(ms)  total:(10)

 

fortiview_request_data()-881: total:7 start:1762905600 end:1762909200

 

data(1762905600-1762909200):

0). srcip-110.110.110.4 | user- | srcdevtype- | srcmac-12:eb:6d:94:b3:8b | srcintf-TWTAC | unauthuser- | fctuid- | sessions-573 | session_allow-573 | session_block-0 | rcvdbyte-72351423 | sentbyte-3122566 | bytes-75473989 | score-0 | score_allow-0 | score_block-0 | duration-0 | 

1). srcip-14.14.14.8 | user- | srcdevtype- | srcmac-58:ef:68:7b:fe:1f | srcintf-LAN_IN | unauthuser- | fctuid- | sessions-168 | session_allow-46 | session_block-122 | rcvdbyte-10936940 | sentbyte-4758691 | bytes-15695631 | score-0 | score_allow-0 | score_block-0 | duration-0 | 

2). srcip-10.1.212.254 | user- | srcdevtype- | srcmac-08:5b:0e:c2:4f:8e | srcintf-WAN_OUT | unauthuser- | fctuid- | sessions-114 | session_allow-114 | session_block-0 | rcvdbyte-557593 | sentbyte-788355 | bytes-1345948 | score-0 | score_allow-0 | score_block-0 | duration-0 | 

3). srcip-212.212.212.1 | user- | srcdevtype- | srcmac- | srcintf-VOIP | unauthuser- | fctuid- | sessions-1 | session_allow-1 | session_block-0 | rcvdbyte-71292 | sentbyte-63461 | bytes-134753 | score-0 | score_allow-0 | score_block-0 | duration-0 | 

4). srcip-212.212.212.2 | user- | srcdevtype- | srcmac- | srcintf-VOIP | unauthuser- | fctuid- | sessions-5 | session_allow-5 | session_block-0 | rcvdbyte-39652 | sentbyte-36390 | bytes-76042 | score-0 | score_allow-0 | score_block-0 | duration-0 | 

5). srcip-14.14.14.100 | user- | srcdevtype- | srcmac-00:0c:29:eb:63:aa | srcintf-LAN_IN | unauthuser- | fctuid- | sessions-6 | session_allow-6 | session_block-0 | rcvdbyte-575 | sentbyte-752 | bytes-1327 | score-0 | score_allow-0 | score_block-0 | duration-0 | 

6). srcip-111.111.111.1 | user- | srcdevtype- | srcmac-e0:23:ff:b4:31:30 | srcintf-port12 | unauthuser- | fctuid- | sessions-109 | session_allow-0 | session_block-109 | rcvdbyte-0 | sentbyte-0 | bytes-0 | score-0 | score_allow-0 | score_block-0 | duration-0 | 

 

To stop the debug, use the commands given below:

 

diagnose debug application miglogd 0

diagnose debug disable

diagnose debug reset