From 27d42bc6b2a2c4306193b84994b3dc3e8aaea7f1 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Sat, 5 Jun 2021 13:58:24 +0200 Subject: [PATCH] fix match for long postfix session IDs, also use \w which makes more sense in this context. --- postfix-log-parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postfix-log-parser.go b/postfix-log-parser.go index 739c2ec..23bc983 100644 --- a/postfix-log-parser.go +++ b/postfix-log-parser.go @@ -11,7 +11,7 @@ const ( TimeRegexpFormat = `([A-Za-z]{3}\s*[0-9]{1,2} [0-9]{2}:[0-9]{2}:[0-9]{2}|^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z))` HostRegexpFormat = `([0-9A-Za-z\.]*)` ProcessRegexpFormat = `(postfix/[a-z]*\[[0-9]{1,5}\])?` - QueueIdRegexpFormat = `([0-9A-Z]*)` + QueueIdRegexpFormat = `([\d\w]*)` MessageDetailsRegexpFormat = `((?:client=(.+)\[(.+)\])?(?:message-id=<(.+)>)?(?:from=<(.+@.+)>)?(?:to=<(.+@.+)>.*status=([a-z]+))?.*)` RegexpFormat = TimeRegexpFormat + ` ` + HostRegexpFormat + ` ` + ProcessRegexpFormat + `: ` + QueueIdRegexpFormat + `(?:\: )?` + MessageDetailsRegexpFormat )