Fail2ban正则表达式与已知日期不匹配

时间:2019-02-15 16:07:39

标签: regex fail2ban

试图确定为什么我的fail2ban正则表达式没有捕获日志条目。日期检测器显示它是正确的格式。

$ fail2ban-regex "[15/Feb/2019:10:50:11 -0500]" "<HOST>"

Running tests
=============

Use   failregex line : <HOST>
Use      single line : [15/Feb/2019:10:50:11 -0500]


Results
=======

Failregex: 0 total

Ignoreregex: 0 total

Date template hits:
|- [# of hits] date format
|  [1] {^LN-BEG}Day(?P<_sep>[-/])MON(?P=_sep)ExYear[ :]?24hour:Minute:Second(?:\.Microseconds)?(?: Zone offset)?
`-

Lines: 1 lines, 0 ignored, 0 matched, 1 missed
[processed in 0.01 sec]

|- Missed line(s):
|  [15/Feb/2019:10:50:11 -0500]

datedetector.py

self._cacheTemplate("%d(?P<_sep>[-/])%m(?P=_sep)(?:%ExY|%Exy) %k:%M:%S")
                # Apache format optional time zone:
                # [31/Oct/2006:09:22:55 -0000]
                # 26-Jul-2007 15:20:52
                # named 26-Jul-2007 15:20:52.252
                # roundcube 26-Jul-2007 15:20:52 +0200

0 个答案:

没有答案