Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?<timestamp>[^ ]*)\.(?<time_microseconds>\d*)\+[^ ]+ (?<host>[^ ]*) postgres\[(?<pid>\d*)\]: \[(?<groupid>[^ ]\d*)-(?<lineid>[^ ]\d*)\](?<message>.*)$
/
gm

Description

Extracts information from PostgreSQL logs.

Submitted by Glenn Stewart - 8 years ago