I had issues with log rotation as well but it was not due to Suricata itself. I did not change its config from suricata.conf rather from logrotate profile. In my case it was running on RHEL, these are the notes I took during debugging.
I hope it helps:
How logorotate works
A script usually present under /etc/logorotate.d/ is read daily by cron (on RHEL, on other distro this could be handled by systemd timers). You can assess this quickly by searching for cron scriptsor systemd timers:
# find /etc/cron* -name 'logrotate'
/etc/cron.daily/logrotate
# systemctl list-timers --all
NEXT LEFT LAST PASSED UNIT ACTIV>
[...]
Also, logrotate tracks logs’ status (timestamp of last rotation) under /var/lib/logrotate/logrotate.status file. This is the file that will be checked to confirm if rotation is needed.
Troubleshooting steps - focused on cron setup
Verify if the logrotate script runs as expected in debug mode (dry run - it won’t do any change): logrotate -d /etc/logrotate.d/suricata
If it works, try rotating manually in verbose mode to confirm it works: logrotate -v /etc/logrotate.d/suricata
Check if it actually rotated the logs ls -lh <path_logs>, if not, inspect logs: