Repository navigation
Filterlog Stops After Rotation
This is a pfSense issue, not a SIEM-stack one, but it takes out two of the data sources this stack relies on. It is worth fixing on every pfSense box that feeds Grafana, whether or not you use pfBlockerNG.
-
/var/log/filter.logstops growing. Often the only line in it is newsyslog'slogfile turned overmessage. - pfBlockerNG's
/var/log/pfblockerng/ip_block.logalso stops, because pfBlockerNG derives its block log from filter.log. - Grafana: pfBlockerNG panels and the firewall-log panels in
pfsense_pfblockerng_system.jsongo to "No data" while everything else keeps working. - Rules are still enforced; only the logging has stopped.
-
./scripts/status.shreportsFilter.log freshness... Staleand/orFilterlog file handle... No file handle.
Quick check from the SIEM server:
ssh admin@<PFSENSE_IP> 'wc -l /var/log/filter.log; ls -l /var/log/filter.log; date'
# 1 line, or an mtime well in the past while traffic is flowing -> you have this problem
ssh admin@<PFSENSE_IP> 'lsof -p $(pgrep filterlog) | grep filter.log'
# No output -> filterlog has no open handle on the live filepfSense's filterlog daemon receives pf log records and writes them to
/var/log/filter.log via syslogd. When newsyslog rotates the file (default trigger:
500 KB), the daemon does not reliably reopen the new file and keeps writing into the
rotated-away handle, or into nothing. The condition persists until filterlog/syslogd is
restarted.
Observed on pfSense CE 2.7.x through 2.8.1 (tracked upstream as pfSense bug #8555). Re-check after upgrading to 2.9.0; if the cron job below never fires on the new release, you can remove it.
How often it bites depends on how quickly filter.log reaches the rotation size. A busy firewall with logging on the default-deny rule can rotate every couple of hours.
Any of these gets logging back within seconds. Use the first one.
SSH (fastest):
ssh admin@<PFSENSE_IP>
php -r 'require_once("/etc/inc/filter.inc"); filter_configure(); system_syslogd_start();'
# pfBlockerNG installed? also re-sync its logging:
php -r 'require_once("/usr/local/pkg/pfblockerng/pfblockerng.inc"); pfblockerng_sync_on_changes();'
tail -f /var/log/filter.log # live entries should appearWeb GUI: Diagnostics > Command Prompt > Execute Shell Command, paste the same
php -r ... line(s), Execute.
Reboot: Diagnostics > Reboot. Works, but is the slowest option.
Status > System Logs > Settings:
-
Log Rotation Size (KB): raise from
500to2000or5000. Fewer rotations means fewer chances to hit the bug. This applies to every log pfSense rotates, not only filter.log. - Log Rotation Count: how many rotated copies to keep; does not affect the bug, only disk use.
This is mitigation, not a fix. Install the cron job below regardless.
Run a small check every 10 minutes on pfSense that restarts filterlog only when
filter.log has gone stale. Doing it through the pfSense Cron package (rather than
crontab -e) matters: Cron-package jobs are stored in config.xml, so they are included
in pfSense backups and survive upgrades, reinstalls and config restores. A hand-edited
/etc/crontab is regenerated by pfSense and your line disappears.
System > Package Manager > Available Packages > search cron > Install.
Services > Cron > Add:
| Field | Value |
|---|---|
| Minute | */10 |
| Hour | * |
| Day of Month | * |
| Month | * |
| Day of Week | * |
| User | root |
| Command | see below |
| Description | Restart filterlog if filter.log is stale |
Command (single line):
/usr/bin/find /var/log/filter.log -mmin +10 -exec sh -c 'php -r "require_once(\"/etc/inc/filter.inc\"); filter_configure(); system_syslogd_start();" && php -r "require_once(\"/usr/local/pkg/pfblockerng/pfblockerng.inc\"); pfblockerng_sync_on_changes();"' \; 2>&1 | logger -t filterlog-monitorWithout pfBlockerNG, drop the second php -r (everything from && to the closing "):
/usr/bin/find /var/log/filter.log -mmin +10 -exec sh -c 'php -r "require_once(\"/etc/inc/filter.inc\"); filter_configure(); system_syslogd_start();"' \; 2>&1 | logger -t filterlog-monitorSave. The job is live immediately.
What it does: find -mmin +10 matches filter.log only if it has not been modified in
the last 10 minutes; when it matches, the -exec restarts filter/syslogd (and pfBlockerNG
logging), and anything printed is tagged filterlog-monitor in /var/log/system.log.
When filter.log is fresh, find matches nothing and the job exits silently.
Tuning: on a very quiet network 10 minutes without a logged packet can be normal, and the
job will restart filterlog needlessly (harmless, but noisy). Raise -mmin +10 to +30
and the schedule to */30 if you see restarts with nothing wrong. On a busy network you
can tighten both to 5.
If you prefer brute force, a Cron-package job with Minute 5, Hour */4, User root
and this command restarts filterlog every four hours regardless of state:
php -r 'require_once("/etc/inc/filter.inc"); filter_configure(); system_syslogd_start();' 2>&1 | logger -t filterlog-restartThe conditional job above is preferred because it also bounds the outage to 10 minutes.
The job is installed. The Cron package renders its config.xml entries into
/etc/crontab (that is why you never edit that file by hand):
ssh admin@<PFSENSE_IP> 'grep filterlog /etc/crontab'Simulate the failure and watch it recover:
ssh admin@<PFSENSE_IP>
pkill -9 filterlog # nothing will be written to filter.log from here
# wait up to 10 minutes for the cron run, then:
grep filterlog-monitor /var/log/system.log | tail -5
tail -5 /var/log/filter.log # fresh entries againOr run the command by hand with -mmin +0 so it fires regardless of age:
/usr/bin/find /var/log/filter.log -mmin +0 -exec sh -c 'php -r "require_once(\"/etc/inc/filter.inc\"); filter_configure(); system_syslogd_start();"' \;
tail -5 /var/log/filter.logCheck pfBlockerNG data is reaching OpenSearch again (from the SIEM server):
curl -s "http://<SIEM_IP>:9200/pfblockerng-*/_count" -H 'Content-Type: application/json' \
-d '{"query":{"range":{"@timestamp":{"gte":"now-1h"}}}}' | jq .countpfBlockerNG events arrive via Telegraf's [[outputs.opensearch]], so a count of 0 here
after filterlog is confirmed healthy points at Telegraf instead. See
TELEGRAF_ON_PFSENSE.md, which also covers the separate
pfBlockerNG log-permissions problem that can starve Telegraf even when filterlog is fine.
./scripts/status.sh already includes a pfSense Filterlog Health section (no changes
needed on your side). Over SSH it:
- reads
stat -f %m /var/log/filter.logand flags the file Stale if it is older than 600 seconds, printing the one-linephp -rfix; - runs
lsof -p $(pgrep filterlog)and flags No file handle if filterlog has no descriptor on filter.log.
Either failure counts toward the script's non-zero exit code, so running status.sh from
a SIEM-side cron or from the pfsense-siem console (option 5) gives you visibility, while
the pfSense Cron-package job above does the actual remediation.
- pfSense bug #8555: upstream tracker
- TELEGRAF_ON_PFSENSE.md: Telegraf on pfSense, including pfBlockerNG log permissions
-
Telegraf on pfSense: the PF Information panel and other Telegraf panels that depend on filter.log /
/dev/pf - TROUBLESHOOTING.md: general troubleshooting
Source: docs/troubleshooting/PFSENSE_FILTERLOG_ROTATION_FIX.md. This wiki is generated from the repository on every push to main; edit the source file and open a pull request rather than editing the wiki page.
This wiki is generated from the Markdown files in pfsense-siem-stack on every push to main. Edits made here are overwritten; edit the source file named at the bottom of each page and open a pull request. Placeholders used throughout: admin@<PFSENSE_IP> is your pfSense SSH login, <SIEM_IP> your SIEM server, interface names like igc0 are examples. Licensed MPL 2.0.
Getting started
Suricata
pfBlockerNG
Telegraf
pfSense platform
- Upgrading pfSense ⭐
- Filterlog Stops After Rotation
- Traffic Shaping Guide
- Shaping Optimization Notes
- October 2026 Tuning Results
- CrowdSec (exploratory)
SIEM: deploy
- Quick Start
- New User Checklist
- SIEM Server Installation
- Forwarder Installation
- GeoIP Setup
- Dashboard Installation
SIEM: operate
- Management Console
- Forwarder Operations and Watchdog
- Multi-Interface and Retention
- Scripts Reference
SIEM: fix