Feature #15766
openEnable autocomplete for log filters
100%
Description
I want to request a new feature or an addition to an existing feature.
When one expands the advanced filter accordion in the Firewall logs section, I would like to see a list of recent (last 5?) queries.
One should be able to click on one of the recent queries listed and have the advanced search filter automatically populated with that previous query.
I find it frustrating to input the same regex filters over and over when troubleshooting, and I would very much like the ability to just click to input the most recent regex or other recent queries to quickly narrow down my logs to exactly the IP, interface, or whatever I just did.
Source IP: 10\.0\.[254]{1}0\.[0-9]{3} # Review traffic leaving from vLAN 20, 50, or 40.
Destination IP: 10\.0\.[367]{1}0\.[0-9]{3} # Review traffic destination for vLAN 30, 60, or 70.
Type: Blocked
As you can imagine, typing that after navigating back to the page or having to copy/paste it gets tedious. Just clicking a "thing" to restore my most recent query would be a huge win and a huge time saver, making troubleshooting via the logs much faster and much more efficient.
Files
Updated by Alexander Snyder 10 days ago
Full disclosure: this implementation was created entirely with AI -- and I'm not the least bit ashamed of that. It was designed, written, and tested using Anthropic's Claude Opus 4.8 running at "Very High" reasoning effort, with me directing and reviewing. It was then tested on a real, production pfSense Plus firewall running 26.03.1-RELEASE (PHP 8.5.2), installed through System > Patches, and confirmed working end-to-end.
Sharing it here as a working, self-contained implementation of this request -- useful as-is, or as a starting point.
What it does
Adds a "Recent Queries" list to the top of the Advanced Log Filter accordion on Status > System Logs > Firewall. Each time a filter is run, that query is remembered (last 5, de-duplicated). Clicking an entry repopulates all of the advanced-filter fields (Source/Destination IP, ports, protocol, protocol flags, interface, tracker ID, time, and the Pass/Block checkboxes) so there's no need to retype the same regexes. Each entry has a remove (x), plus a "clear all".
- Purely client-side: history lives in the browser (localStorage key
pf_fwlog_recent_queries_v1); nothing is written server-side. - The patch only appends an inline <script> block to
usr/local/www/status_logs_filter.phpimmediately before thefoot.incinclude -- no existing PHP logic is modified. - Click = populate only (it does not auto-submit), so you can tweak the fields before hitting Apply Filter.
- No-ops on the raw/simple filter view, and degrades gracefully if the field IDs ever change.
Installed via System > Patches with: Path Strip Count = 1, Base Directory = /, Ignore Whitespace, and Auto Apply (so it survives upgrades).
Attached: recent_queries_fwlog.patch (unified diff; sha256 83ec311af4d0594ae3a5cc0f7df1d34d5d8c762b996fd160b4252524097038c0).
Updated by Marcos M 8 days ago
- Project changed from pfSense Plus to pfSense
- Subject changed from Restore previous queries to Enable autocomplete for log filters
- Category changed from Logging to Logging
- Status changed from New to Feedback
- Assignee set to Marcos M
- Target version set to 2.9.0
- % Done changed from 0 to 100
- Plus Target Version set to 26.10
Implemented with a03f8277a3523cb0139f840d4dcf48dd27ec45cf. Show
Updated by Marcos M about 24 hours ago
- Target version changed from 2.9.0 to CE-Next