mirror of https://github.com/fail2ban/fail2ban
ENH+DOC: Allow setting of Epoch and TAI64N date pattern
Also add this to jail.conf man pagepull/364/head
parent
e07df3f7d4
commit
9c61adcad7
|
@ -28,7 +28,7 @@ from failmanager import FailManager
|
|||
from ticket import FailTicket
|
||||
from jailthread import JailThread
|
||||
from datedetector import DateDetector
|
||||
from datetemplate import DatePatternRegex, DateISO8601
|
||||
from datetemplate import DatePatternRegex, DateISO8601, DateEpoch, DateTai64n
|
||||
from mytime import MyTime
|
||||
from failregex import FailRegex, Regex, RegexException
|
||||
|
||||
|
@ -199,9 +199,15 @@ class Filter(JailThread):
|
|||
|
||||
def setDatePattern(self, pattern):
|
||||
dateDetector = DateDetector()
|
||||
if pattern == "ISO8601":
|
||||
if pattern.upper() == "ISO8601":
|
||||
template = DateISO8601()
|
||||
template.setName("ISO8601")
|
||||
elif pattern.upper() == "EPOCH":
|
||||
template = DateEpoch()
|
||||
template.setName("Epoch")
|
||||
elif patter.upper() == "TAI64N":
|
||||
template = DateTai64n()
|
||||
template.setName("TAI64N")
|
||||
else:
|
||||
template = DatePatternRegex()
|
||||
if pattern[0] == "^": # Special extra to enable anchor
|
||||
|
|
|
@ -183,6 +183,9 @@ The following are acceptable format fields (see strptime(3) for descriptions):
|
|||
.nf
|
||||
%% %a %A %b %B %d %H %I %j %m %M %p %S %U %w %W %y %Y
|
||||
.fi
|
||||
.br
|
||||
|
||||
Also, special values of \fIEpoch\fR (UNIX Timestamp), \fITAI64N\fR and \fIISO8601\fR can be used.
|
||||
.TP
|
||||
\fBjournalmatch\fR
|
||||
specifies the systemd journal match used to filter the journal entries. See \fBjournalctl(1)\fR and \fBsystemd.journal-fields(7)\fR for matches syntax and more details on special journal fields. This option is only valid for the \fIsystemd\fR backend.
|
||||
|
|
Loading…
Reference in New Issue