mirror of https://github.com/fail2ban/fail2ban
- Added TAI64N support
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@227 a942ae1a-1317-0410-a47c-b1dcaea8d6050.6
parent
be26cd5b75
commit
fb07353aeb
|
@ -202,7 +202,13 @@ class LogReader:
|
||||||
value.
|
value.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
date = list(time.strptime(value, self.timepattern))
|
# Check if the parsed value is in TAI64N format
|
||||||
|
if not self.timepattern.lower() == "tai64n":
|
||||||
|
date = list(time.strptime(value, self.timepattern))
|
||||||
|
else:
|
||||||
|
# extract part of format which represents seconds since epoch
|
||||||
|
seconds_since_epoch = value[2:17]
|
||||||
|
date = list(time.gmtime(int(seconds_since_epoch, 16)))
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
logSys.error(e)
|
logSys.error(e)
|
||||||
logSys.error("Please check the format and your locale settings.")
|
logSys.error("Please check the format and your locale settings.")
|
||||||
|
|
Loading…
Reference in New Issue