Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?<time>[^ +][-:0-9TZ]+|[[:upper:]][[:lower:]]{2}[ -:+0-9TZ]*)([^ ][+0:]+|\s+)(\s*)(?<host>[^ ][-\w\d]+)(\s*)(?<service>[^ [][-_\w]+)(\[(?<pid>[^ \]][\d]*)\]):\s*((\[\s*(?<mtime>[^ ][\w: \/]+)\]\s*\[\s*(?<severity>[^ ][\w]+)\]\s*){0,1}\s*\[\s*(?<component>[^ ][\w:]+)\]){0,1}\s*(?<message>.*){0,1}.*$
/
gxm

Description

Fluentbit systemd logs

Submitted by anonymous - 7 years ago