Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
(\w\w\w \d\d \d\d:\d\d:\d\d) ([\w-\.]+) (\w+\[\d+\]): ([^:]+): ([^\/]+)\/([^@]+)@([\d\.]+):(\d+) (.*$)
"

Description

Regex to read pgbouncer's log lines when it's logging to syslog, and break it into useful groups.

Submitted by Josh Berkus - 9 years ago