Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

/
(?<time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}) (?<level>\S*) (?<processor>\S*) (?<serviceLayer>\S*):(?<lineNumber>\d*) - (?<mess>.*)
/
g

Description

This pulls out all the fields in a log4j field. Suitable for use in a Logstash Grok pattern or similar

Submitted by Robin Kearney - 10 years ago