ENH: strip CR and LF while analyzing the lines (processLine) (Close #202)

This should allow to resolve issues with logs written in MS-DOS fashion,
e.g. with daemontools

See https://github.com/fail2ban/fail2ban/issues/202\#issuecomment-17393613
This commit is contained in:
Yaroslav Halchenko 2013-05-08 12:07:26 -04:00
parent 2b1e19933f
commit 6fef85ff2d
2 changed files with 24 additions and 5 deletions

View file

@ -290,6 +290,7 @@ class Filter(JailThread):
l = line.decode('utf-8')
except UnicodeDecodeError:
l = line
l = l.rstrip('\r\n')
timeMatch = self.dateDetector.matchTime(l)
if timeMatch:
# Lets split into time part and log part of the line