mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2026-09-25 20:31:52 +02:00
fix: Simplify timestamp parsing by removing timezone and format configuration
This commit is contained in:
@@ -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"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user