Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?P<month>\S{3})? {1,2}(?P<day>\S+) (?P<time>\S+) (?P<hostname>\S+) (?P<process>.*?(?=: \[|\[|\())[^a-zA-Z0-9]{1,3}(?P<pid>.+?(?=\]|\))|)[^a-zA-Z0-9]{1,2}(?P<info>.*)
/
gm

Description

Grouping for standard ubuntu server syslog messages.

Submitted by Jason King - 2 years ago