Browse Source

(grave) closes gh-2431: replace newlines in message from systemd journal (otherwise multi-line parsing is broken, because removal of matched string from multi-line buffer window is confused by extra new-lines, so they are retained and got matched on every followed message).

pull/2369/merge
sebres 6 years ago
parent
commit
83f626c4aa
  1. 2
      fail2ban/server/filtersystemd.py

2
fail2ban/server/filtersystemd.py

@ -232,7 +232,7 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
logSys.debug("Read systemd journal entry: %r" %
"".join([date.isoformat(), logline]))
## use the same type for 1st argument:
return ((logline[:0], date.isoformat(), logline),
return ((logline[:0], date.isoformat(), logline.replace('\n', '\\n')),
time.mktime(date.timetuple()) + date.microsecond/1.0E6)
def seekToTime(self, date):

Loading…
Cancel
Save