From 7e637aa3f85ecf42e7802f33476315bbb43af472 Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Wed, 30 Oct 2019 21:46:26 +0100 Subject: [PATCH] Update date format regex This regex will be used to cut off the leading timestamp. --- OOMAnalyser.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OOMAnalyser.py b/OOMAnalyser.py index e87662c..f8d86ec 100644 --- a/OOMAnalyser.py +++ b/OOMAnalyser.py @@ -56,10 +56,12 @@ class OOM(object): """Hold OOM object and provide access""" REC_TIMESTAMP = re.compile( - r'(' - r'\[\s+\d+\.\d+\]' + r'^(' + # pattern for date format: Jul 28 10:48:41 + r'[A-Z]+[\w ]+ +\d{1,2} \d{2}:\d{2}:\d{2} \d{4}' r'|' - r'\[[A-Z]+[\w ]+ +\d{1,2} \d{2}:\d{2}:\d{2} \d{4}\]' + # pattern for date format: 2019-10-30T08:13:31.896744+00:00 + r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3,6}\+\d{2}:\d{2}' r') ', re.ASCII) current_line = 0