Skip to content

Commit

Permalink
examples/postfix.mtail - move dash to end of character class
Browse files Browse the repository at this point in the history
Otherwise the "application" regex group won't match a string such as
"postfix/postfix-script"
  • Loading branch information
andreby committed Oct 13, 2023
1 parent 7045110 commit 99f8197
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/postfix.mtail
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const QMGR_INSERT_LINE /:.*, size=(?P<size>\d+), nrcpt=(?P<nrcpt>\d+)/
const QMGR_REMOVE_LINE /: removed$/

/^(?P<date>(?P<legacy_date>\w+\s+\d+\s+\d+:\d+:\d+)|(?P<rfc3339_date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+[+-]\d{2}:\d{2}))/ +
/\s+(?:\w+@)?(?P<hostname>[\w\.-]+)\s+postfix\/(?P<application>[\w\.-\/]+)(?:\[(?P<pid>\d+)\])?:\s+(?P<message>.*)/ {
/\s+(?:\w+@)?(?P<hostname>[\w\.-]+)\s+postfix\/(?P<application>[\w\.\/-]+)(?:\[(?P<pid>\d+)\])?:\s+(?P<message>.*)/ {
len($legacy_date) > 0 {
strptime($2, "Jan _2 15:04:05")
}
Expand Down

0 comments on commit 99f8197

Please sign in to comment.