Regular Expressions 101

Community Patterns

1...45678...747

Log Capture

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(\w{3} \d{2} \d{2}:\d{2}:\d{2}) ([a-z]+) ([\w\d\[\]]+): (.*)$
/
gm

Description

Capture the date, host, message type, and message from the patterns in the log file.

Submitted by Nicholas Tower - 2 years ago