Project

General

Profile

Actions

Bug #14587

open

Firewall Log Sort By Time

Added by Brian Shell 9 months ago. Updated 9 months ago.

Status:
New
Priority:
Very Low
Assignee:
-
Category:
System Logs
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
Affected Architecture:

Description

When viewing the System Logs > Firewall, and trying to sort by Time with newest first, it appears the sort is working alphabetically instead of chronologically. For example, this is the order I see when attempting to sort. Don't be concerned about the gaps of time between as this is simply due to to events being logged during those times and that is expected based on the logging I have enabled. Jun 30, Jun 28, Jun 27, Jun 26, Jun 25, Jun 24, Jun 23, Jun 22, Jun 21, Jul 6, Jul 4, Jul 18, Jul 13, Jul 10. Hopefully this will be something reproducible so a developer can see it because it is hard to explain in words. Attaching part of a screenshot so you can see the sorting. You won't see the issue from my screenshot I would have to scroll down and send many pages of screens.


Files

screenshot.png (27.6 KB) screenshot.png Brian Shell, 07/18/2023 03:12 PM
Actions #1

Updated by Jim Pingle 9 months ago

  • Project changed from pfSense Plus to pfSense
  • Category changed from Web Interface to System Logs

The sortable table code is usually smart enough to pick up on date fields but apparently not in this case. When the logs use RFC 3164 format the date string may be one it doesn't recognize.

I'm not sure how viable it will be to work around that but it should be possible one way or another. There are ways to set properties on the fields to nudge the sortable code to handle such things better, such as data-sortable-type on the <th> tag or data-value on the <td> tag.

If you set the logs to RFC 5424 format they would sort naturally even in alphabetical order since the date string there is quite a bit different. For example, it is 2023-07-18 10:28:03.492938-04:00 -- and since the date is in YYYY-MM-DD that sorts well either way.

Actions #2

Updated by Brian Shell 9 months ago

Setting the logging to RFC-5424 does indeed work around the issue, thank you. I don't have the programming skills to implement the code changes you suggested, but maybe someone else will. For now, the workaround is sufficient.

Actions #3

Updated by Jim Pingle 9 months ago

Brian Shell wrote in #note-2:

Setting the logging to RFC-5424 does indeed work around the issue, thank you. I don't have the programming skills to implement the code changes you suggested, but maybe someone else will. For now, the workaround is sufficient.

Good to hear the workaround helped. The notes I left there were more for other devs (or an enterprising community member) in case someone wanted to take it on before I would have time to look at it eventually.

Actions

Also available in: Atom PDF