Technical Tip: Resolving sudden change of number of Archive Log days in FortiAnalyzer
| Description | This article describes the steps to resolve log retention issues in FortiAnalyzer, where the reported Archive Days can suddenly vary. |
| Scope | FortiAnalyzer. |
| Solution | In FortiAnalyzer, there are two types of logs:
As long as a log file is not rotated, it will not be taken into account towards the total number of Archived Days. In the following example, a total of 109 days of Archive Logs can be seen:
A few days later, the calculation increases to 241 days of Archive Logs:
Checking in the CLI with a command and in the GUI via Log Browse will reveal that certain older log files did not rotate until recently, increasing the total number of Archive Day Logs available, which can be misleading:
diagnose system filesystem list /Storage/Logs/
There are several reasons why a log file in FortiAnalyzer might not be rotated, which directly affect how it contributes to the total number of archived days.
File size not reached: FortiAnalyzer rotates logs only after they exceed a configured size (commonly 200 MB). If the log volume is low, files remain open longer and are not counted as archived.
Insufficient disk space: When storage capacity or inodes are nearly full, FortiAnalyzer halts log rotation to prevent corruption.
Long retention periods: Even after new logs roll over, older files remain until retention time expires, giving the impression of delayed rotation.
Note: A single log file for one device can affect the calculation of Archive Days, as it takes the oldest existing file. Deleting these stale files will force FortiAnalyzer to recalculate, showing a more accurate number.
To limit every archive log file to a single day of logs, change the log rolling schedule under System Settings -> Advanced -> Device Log Settings. When rolling is configured to run daily at 00:00, no single log file will contain more than one day of logs. |



