Created
May 15, 2019 01:33
-
-
Save ryaminal/70d308f6efbeefb9f219406044ee5458 to your computer and use it in GitHub Desktop.
parser-rewrite-noformat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
lineGroupers: [ | |
{ | |
start: "^\\d{4}-\\d{2}-\\d+ \\d{2}:\\d{2}:\\d{2},\\d+", | |
haltBefore: "^\\d{4}-\\d{2}-\\d+ \\d{2}:\\d{2}:\\d{2},\\d+" | |
} | |
], | |
patterns: { | |
axTs: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{9}", | |
axTz: "[\\-\\+]\\d{2}:\\d{2}", | |
axTsTz: "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{9}[\\-\\+]\\d{2}:\\d{2}" | |
ymdnum: "\\d+-\\d+-\\d+\\s+[0-9:]+,[0-9]{3}", | |
}, | |
formats: [ | |
{ | |
format: ".*logType=Systemd.*\"MESSAGE\":\"$severity$ $_=axTsTz$ \\[$thread$\\|$line$\\] $_$", | |
halt: false, | |
}, | |
{ | |
id: "log-message-with-id", | |
format: "$logTS=ymdnum$ - ${parse=commaKeyValues}$ $msg{parse=json}$", | |
halt: false, | |
rewrites: [ | |
{ | |
input: "msgMESSAGE", | |
output: "z_ignoreMESSAGE", | |
match: "^!!!", | |
replace: "!!!" | |
}, { | |
input: "msgMessage", | |
output: "z_ignoreM_essage", | |
match: "^!!!", | |
replace: "!!!" | |
}, { | |
input: "msgDate", | |
output: "timestamp", | |
match: ".*", | |
replace: "$0" | |
} | |
] | |
}, { | |
format: ".*logType=Systemd.*", | |
halt: true, | |
rewrites: [ | |
{ | |
input: "z_ignoreMESSAGE", | |
output: ".", | |
match: "^!!!$", | |
replace: "$0" | |
}, | |
{ | |
input: "z_ignoreMESSAGE", | |
output: ".", | |
match: ".*\"MESSAGE\":.*", | |
replace: "thing" | |
} | |
] | |
}, { | |
format: ".*\"message\":.*", | |
halt: true, | |
rewrites: [ | |
{ | |
input: "z_ignoreM_essage", | |
output: ".", | |
match: "^!!!$", | |
replace: "$0" | |
} | |
] | |
}, { | |
id: "log-fallthrough", | |
format: "$msg$" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment