IPS logging: Fix reading date
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Apr 2019 16:32:02 +0000 (17:32 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Apr 2019 16:32:02 +0000 (17:32 +0100)
The CGI script only compares mm/dd and does not care about the year.

Suricata, however, logs the year as well which has to be ignored here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/logs.cgi/ids.dat

index 1447a06..5e46137 100644 (file)
@@ -447,8 +447,8 @@ sub processevent
                                $destport = $10;
                        }
 
-                       if ($_  =~ m/^([0-9\/]{3,10})\-([0-9\:]{5,8})\.([0-9]{1,14})/) {
-                               ($date,$time) = ($1,$2);
+                       if ($_  =~ m/^([0-9\/]{3,5})(\/\d+)?\-([0-9\:]{5,8})\.([0-9]{1,14})/) {
+                               ($date,$time) = ($1,$3);
                        }
                        if ($_ =~ m/\[Xref \=\>.*\]/) {
                                $_ =~ s/\]\[Xref \=\> /, /g;