From fa97c55ad962bfb3bb2fad029b101df4503c452b Mon Sep 17 00:00:00 2001 From: Stephan Geulette Date: Fri, 11 Oct 2024 14:47:32 +0200 Subject: [PATCH] Updated date pattern --- src/imio/fpaudit/storage.py | 2 +- src/imio/fpaudit/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imio/fpaudit/storage.py b/src/imio/fpaudit/storage.py index e77491a..1c54969 100644 --- a/src/imio/fpaudit/storage.py +++ b/src/imio/fpaudit/storage.py @@ -41,7 +41,7 @@ def store_config(logs_config): entry["log_id"], logformat=entry["log_format"], ) - log_i.handler.formatter.datefmt = "%y-%m-%d %H:%M:%S" + log_i.handler.formatter.datefmt = "%Y-%m-%d %H:%M:%S" dic[entry["log_id"]] = log_i storage = getUtility(ILogsStorage) storage.set(dic) diff --git a/src/imio/fpaudit/utils.py b/src/imio/fpaudit/utils.py index 11a457d..73fc633 100644 --- a/src/imio/fpaudit/utils.py +++ b/src/imio/fpaudit/utils.py @@ -49,7 +49,7 @@ def get_lines_info(line, extras): dic = {} # 24-10-10 14:59:07 - user=admin ip=127.0.0.1 action=AUDIT col_a=xxxx col_b=yyy pattern = ( - r"(?P\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) - user=(?P.+?) " + r"(?P\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) - user=(?P.+?) " r"ip=(?P[\d\.]+|None) action=(?P.+?)" )