Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Date format Suricata

    IDS/IPS
    5
    27
    1.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      manilx @manilx
      last edited by

      @manilx P.S: The format used in the widget is fine!

      ScreenShot 2023-03-06 at 11.07.51.png

      Netgate 8200max

      1 Reply Last reply Reply Quote 0
      • bmeeksB
        bmeeks
        last edited by

        I will see what I can do to make this a little more configurable. There are some limitations on the ALERTS tab with available column widths. That's the reason the two-digit year format was chosen. Space overall across the table is constrained by the way formatting is done in bootstrap.

        Perhaps using the Dashboard Widget format as @manilx suggests is the best compromise. That will not cause a column width problem, and I really doubt anyone has an ALERTS tab showing alerts from a previous year except for maybe early in January of a new year.

        1 Reply Last reply Reply Quote 3
        • bmeeksB
          bmeeks
          last edited by bmeeks

          Oops! Upon further reflection on this, using the Dashboard Widget data format with just the three-letter abbreviated month and then the day of the month will cause big-time sorting issues. When sorting the column contents the bootstrap code by default is going to use alphanumeric sorting, so "Apr" would come before "Mar", and that is incorrect in terms of ascending dates, for example.

          Now I remember the main reason I made the switch to American format for the dates 😊 . It was so the bootstrap column sorting would work. Prior to pfSense migrating the GUI code to bootstrap, there was no table column sorting and so the displayed date format did not matter. Now, with table column sorting built into the GUI, the format of data does matter. When column sorting was first introduced, users were complaining because the default text sorting of the Alert Date column was not correct using anything other than YY-MM-DD for the date format.

          I need to see if the current pfSense bootstrap environment includes the Moment.js component so that the format of the date field can be specified in the table column header field to control how bootstrap sorts the column.

          I'm not giving up, but the task just got a little more complicated.

          M fireodoF 2 Replies Last reply Reply Quote 0
          • M
            manilx @bmeeks
            last edited by

            @bmeeks YY-MM-DD would be OK for all countries....

            Netgate 8200max

            bmeeksB 1 Reply Last reply Reply Quote 0
            • bmeeksB
              bmeeks @manilx
              last edited by bmeeks

              @manilx said in Date format Suricata:

              @bmeeks YY-MM-DD would be OK for all countries....

              The Moment.js module, when included in a Bootstrap environment, lets you specify the format of a date colum so that Bootstrap sorts it correctly.

              The way Bootstrap sorting works is on the client itself. The server (pfSense in our case) spits out the entire HTML document to the browser which displays it. Embedded within the HTML are a series of Javascript functions for various Bootstrap things. One of those is the table sorting routine. When you click a colunn header to sort a column, it's not pfSense that does that. It is the Javascript code running within the browser. And that code needs to know what "format' of data it is sorting in the HTML tables.

              1 Reply Last reply Reply Quote 0
              • fireodoF
                fireodo @bmeeks
                last edited by

                @bmeeks said in Date format Suricata:

                I'm not giving up, but the task just got a little more complicated.

                This is how pfblockerNG presents the alerts:

                Bildschirmfoto zu 2023-03-06 15-40-38.png

                Could that be a clou?

                Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
                SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
                pfsense 2.7.2 CE
                Packages: Apcupsd Cron Iftop Iperf LCDproc Nmap pfBlockerNG RRD_Summary Shellcmd Snort Speedtest System_Patches.

                M bmeeksB 2 Replies Last reply Reply Quote 0
                • M
                  manilx @fireodo
                  last edited by

                  @fireodo fine with that. Just the numeric MM-DD is SO weird for us europeans ;)

                  Netgate 8200max

                  bmeeksB 1 Reply Last reply Reply Quote 0
                  • bmeeksB
                    bmeeks @fireodo
                    last edited by bmeeks

                    @fireodo said in Date format Suricata:

                    @bmeeks said in Date format Suricata:

                    I'm not giving up, but the task just got a little more complicated.

                    This is how pfblockerNG presents the alerts:

                    Bildschirmfoto zu 2023-03-06 15-40-38.png

                    Could that be a clou?

                    If you change that column sort direction, does it work properly with dates that have "Apr" in them? The problem I was talking about only happens when you get the right combinations of alert dates. For example, if you had alerts from January through May, your sorting would be "off". If you sorted "Ascending" you expect January alerts to come first, then February, March, April, etc. But depending on how Bootstrap interprets the column it might sort with "April" alerts first, then February, etc., because it is looking at just the alphabetical ordering of the month. That's obviously wrong.

                    It's possible that either Moment.js or something siimilar is present with the Bootstrap environmnet on pfSense. To be honest I've just not kept up with the changes in Bootstrap as I have not needed to.

                    fireodoF 1 Reply Last reply Reply Quote 0
                    • bmeeksB
                      bmeeks @manilx
                      last edited by

                      @manilx said in Date format Suricata:

                      @fireodo fine with that. Just the numeric MM-DD is SO weird for us europeans ;)

                      I undertand that. The European date format is also "weird" to Americans 🙂. Hopefully I can find a fully configurable answer.

                      1 Reply Last reply Reply Quote 0
                      • fireodoF
                        fireodo @bmeeks
                        last edited by

                        @bmeeks said in Date format Suricata:

                        For example, if you had alerts from January through May, your sorting would be "off".

                        You're right!

                        Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
                        SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
                        pfsense 2.7.2 CE
                        Packages: Apcupsd Cron Iftop Iperf LCDproc Nmap pfBlockerNG RRD_Summary Shellcmd Snort Speedtest System_Patches.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.