From: Andrew Lewis Date: Mon, 20 Mar 2017 04:57:04 +0000 (+0200) Subject: [Fix] Rspamadm grep: deal with unusually-formatted logs X-Git-Tag: 1.5.4~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5c01afa57bfde74b6f566c9874e84c167275577;p=thirdparty%2Frspamd.git [Fix] Rspamadm grep: deal with unusually-formatted logs --- diff --git a/src/rspamadm/grep.lua b/src/rspamadm/grep.lua index e49977a1dd..68dc2a92c0 100644 --- a/src/rspamadm/grep.lua +++ b/src/rspamadm/grep.lua @@ -45,7 +45,7 @@ return function(_, res) end else for line in h:lines() do - local hash = string.match(line, '^%d+-%d+-%d+ %d+:%d+:%d+ #%d+%(%a+%) <(%x+)>') + local hash = string.match(line, '<(%x+)>') local already_matching = false if hash then if matches[hash] then @@ -79,7 +79,7 @@ return function(_, res) matches[hash] = buffer[hash] end end - local is_end = string.match(line, '^%d+-%d+-%d+ %d+:%d+:%d+ #%d+%(%a+%) <%x+>; task; rspamd_protocol_http_reply:') + local is_end = string.match(line, '<%x+>; task; rspamd_protocol_http_reply:') if is_end then buffer[hash] = nil if matches[hash] then