This article describes that the IPsec VPN log provides statistics of the received and transferred traffic over the tunnel and also tunnel information regarding the local and remote gateway and etc.

This information is usually used to track the bandwidth used by the clients or the tunnel.

Scope FortiGate.

The below setting is used to set a desired interval for IPsec VPN log generation, the interval can be set between 60 to 86400 seconds.


The default value is 600 seconds.


# config system settings
    set vpn-stats-log ipsec
    set vpn-stats-period 100

For instance, in the above setting, a VPN log is generated every 100 seconds.


The same setting can be used for PPTP, L2TP, and SSL VPN:


# config system settings
    set vpn-stats-log  ipsec/pptp/l2tp/ssl
    set vpn-stats-period 600


Example of IPsec stat log:


date=2023-01-30 time=02:37:23 eventtime=1675042643533198368 tz="+0100" logid="0101037141" type="event" subtype="vpn" level="notice" vd="root"
logdesc="IPsec tunnel statistics" msg="IPsec tunnel statistics" action="tunnel-stats" remip= locip= remport=500 locport=500
outintf="wan1" cookies="ba1c042b1d5e6c81/5192227d7758abcf" user="N/A" group="N/A" useralt="N/A" xauthuser="N/A" xauthgroup="N/A" assignip=N/A
vpntunnel="dialup-client" tunnelip=N/A tunnelid=2063828758 tunneltype="ipsec" duration=483 sentbyte=13112 rcvdbyte=16344 nextstat=600 advpnsc=0 



nextstat shows the value of the vpn-stats-period.