mirror of https://github.com/fail2ban/fail2ban
datepattern: fix epoch/long-epoch name, if custom pattern specified
parent
6dc9c23a25
commit
79019967a7
|
@ -207,12 +207,12 @@ class DateEpoch(DateTemplate):
|
||||||
|
|
||||||
def __init__(self, lineBeginOnly=False, pattern=None, longFrm=False):
|
def __init__(self, lineBeginOnly=False, pattern=None, longFrm=False):
|
||||||
DateTemplate.__init__(self)
|
DateTemplate.__init__(self)
|
||||||
self.name = "Epoch"
|
self.name = "Epoch" if not pattern else pattern
|
||||||
self._longFrm = longFrm;
|
self._longFrm = longFrm;
|
||||||
self._grpIdx = 1
|
self._grpIdx = 1
|
||||||
epochRE = r"\d{10,11}\b(?:\.\d{3,6})?"
|
epochRE = r"\d{10,11}\b(?:\.\d{3,6})?"
|
||||||
if longFrm:
|
if longFrm:
|
||||||
self.name = "LongEpoch";
|
self.name = "LongEpoch" if not pattern else pattern
|
||||||
epochRE = r"\d{10,11}(?:\d{3}(?:\.\d{1,6}|\d{3})?)?"
|
epochRE = r"\d{10,11}(?:\d{3}(?:\.\d{1,6}|\d{3})?)?"
|
||||||
if pattern:
|
if pattern:
|
||||||
# pattern should capture/cut out the whole match:
|
# pattern should capture/cut out the whole match:
|
||||||
|
|
Loading…
Reference in New Issue