]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
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 1447a06f0559f790f5e1f51a5b59e26ca97b7c4d..5e4613753cb3d33c410047b5023691bdcd938505 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;