Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IcingaWeb2 - Display of Audit-Log fields wrong #5

Closed
McBane87 opened this issue Jan 3, 2019 · 1 comment
Closed

IcingaWeb2 - Display of Audit-Log fields wrong #5

McBane87 opened this issue Jan 3, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@McBane87
Copy link

McBane87 commented Jan 3, 2019

in IcingaWeb2 "System -> Audit Log" the fields are not getting displayed correctly from the log file, because the regex in "LogController.php" is incomplete.
This line, for example, doesn't get splitted correctly:

2019-01-03T10:04:39+01:00 - bob@a-blub.com - monitoring/command - Issued command actions/remove-downtime with the following payload: {"downtime":"ABC12345!f519ef33-9b9c-49cc-8c29-cccc369cd9ea"}

But if I change the regex like this, it is working:

--- application/controllers/LogController.php  2018-07-19 10:02:09.000000000 +0200
+++ application/controllers/LogController.php       2019-01-03 14:13:41.461248308 +0100
@@ -35,8 +35,8 @@
             'filename'  => $file,
             'fields'    => '/(?<!.)(?<datetime>[0-9]{4}(?:-[0-9]{2}){2}'    // date
                 . 'T[0-9]{2}(?::[0-9]{2}){2}(?:[\+\-][0-9]{2}:[0-9]{2})?)'  // time
-                . ' - (?<identity>.*)'                                      // identity
-                . ' - (?<type>[A-Za-z]+)'                                   // type
+                . ' - (?<identity>.*?)'                                      // identity
+                . ' - (?<type>[A-Za-z\/]+)'                                   // type
                 . ' - (?<message>.*)(?!.)/msS'                              // message
         ]));
 

Please note the "?" at the end of the "identity" regex-part and the "/" inside the "type" regex-part

@n0braist
Copy link

Hi, I had the same problem but used
. ' - (?<type>.*)' // type

@nilmerg nilmerg added the bug Something isn't working label Mar 21, 2019
@nilmerg nilmerg self-assigned this Apr 30, 2019
@nilmerg nilmerg added this to the 1.1 milestone Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants