From 35aa32389a6775ff338a3c2c2547f3afea1bfc49 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 8 Sep 2026 23:41:10 +0200 Subject: [PATCH] fix: Simplify timestamp parsing by removing timezone and format configuration --- log-alert/config.json | 4 +--- log-alert/filters/timestamp.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/log-alert/config.json b/log-alert/config.json index 6fda10c..3f4b466 100644 --- a/log-alert/config.json +++ b/log-alert/config.json @@ -110,9 +110,7 @@ { "type": "timestamp", "config": { - "source-field": "timestamp", - "timezone": "Europe/Paris", - "timestamp-format": "%Y-%m-%dT%H:%M:%S.%f" + "source-field": "timestamp" } }, { diff --git a/log-alert/filters/timestamp.py b/log-alert/filters/timestamp.py index 2b870a6..f623aa9 100644 --- a/log-alert/filters/timestamp.py +++ b/log-alert/filters/timestamp.py @@ -34,7 +34,7 @@ class TimestampFilter(Filter): parsed_time = parsed_time.replace(year=datetime.datetime.now().year) timestamp_value = int(parsed_time.replace(tzinfo=ZoneInfo(self.timezone)).timestamp()) else: - timestamp_value = int(timestamp_string) + timestamp_value = int(datetime.datetime.fromisoformat(timestamp_string).timestamp()) except Exception as e: logger.error(f"Error parsing timestamp {timestamp_value} with format {self.timestamp_format}: {e}")