]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Rspamadm grep: deal with unusually-formatted logs
authorAndrew Lewis <nerf@judo.za.org>
Mon, 20 Mar 2017 04:57:04 +0000 (06:57 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 20 Mar 2017 04:57:04 +0000 (06:57 +0200)
src/rspamadm/grep.lua

index e49977a1ddb4258fa73130f5ce093a1f04d84e10..68dc2a92c06e0006df6c8dc6824478fef35f00c0 100644 (file)
@@ -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