From 19f9cb864f292f616e2508b22c379be54f143148 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Sun, 6 Jun 2021 21:34:33 +0200 Subject: [PATCH] fix process name which can also be "trivial-rewrite" sometimes --- postfix-log-parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postfix-log-parser.go b/postfix-log-parser.go index 739c2ec..b23bd7b 100644 --- a/postfix-log-parser.go +++ b/postfix-log-parser.go @@ -10,8 +10,8 @@ const ( TimeFormatISO8601 = "2006-01-02T15:04:05.999999-07:00" 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]*)` + ProcessRegexpFormat = `(postfix/[\w\-]+\[[0-9]{1,5}\])?` + QueueIdRegexpFormat = `([\d\w]*)` MessageDetailsRegexpFormat = `((?:client=(.+)\[(.+)\])?(?:message-id=<(.+)>)?(?:from=<(.+@.+)>)?(?:to=<(.+@.+)>.*status=([a-z]+))?.*)` RegexpFormat = TimeRegexpFormat + ` ` + HostRegexpFormat + ` ` + ProcessRegexpFormat + `: ` + QueueIdRegexpFormat + `(?:\: )?` + MessageDetailsRegexpFormat )