mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-05-13 14:36:43 +00:00
simplify timestamp conversion in systemd journal reader;
also handle DST flag correct, so doesn't mistakenly consider the UTC timestamp as local timestamp, see #2882
This commit is contained in:
parent
0a8356dd31
commit
732dc86ef3
1 changed files with 1 additions and 1 deletions
|
|
@ -301,7 +301,7 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
|
|||
date = logentry.get('_SOURCE_REALTIME_TIMESTAMP')
|
||||
if date is None:
|
||||
date = logentry.get('__REALTIME_TIMESTAMP')
|
||||
return (date.isoformat(), time.mktime(date.timetuple()) + date.microsecond/1.0E6)
|
||||
return (date.isoformat(), date.timestamp())
|
||||
|
||||
##
|
||||
# Format journal log entry into syslog style
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue