fix: Simplify timestamp parsing by removing timezone and format configuration

This commit is contained in:
2026-09-08 23:41:10 +02:00
parent 701b5b077f
commit 35aa32389a
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -110,9 +110,7 @@
{ {
"type": "timestamp", "type": "timestamp",
"config": { "config": {
"source-field": "timestamp", "source-field": "timestamp"
"timezone": "Europe/Paris",
"timestamp-format": "%Y-%m-%dT%H:%M:%S.%f"
} }
}, },
{ {
+1 -1
View File
@@ -34,7 +34,7 @@ class TimestampFilter(Filter):
parsed_time = parsed_time.replace(year=datetime.datetime.now().year) parsed_time = parsed_time.replace(year=datetime.datetime.now().year)
timestamp_value = int(parsed_time.replace(tzinfo=ZoneInfo(self.timezone)).timestamp()) timestamp_value = int(parsed_time.replace(tzinfo=ZoneInfo(self.timezone)).timestamp())
else: else:
timestamp_value = int(timestamp_string) timestamp_value = int(datetime.datetime.fromisoformat(timestamp_string).timestamp())
except Exception as e: except Exception as e:
logger.error(f"Error parsing timestamp {timestamp_value} with format {self.timestamp_format}: {e}") logger.error(f"Error parsing timestamp {timestamp_value} with format {self.timestamp_format}: {e}")