Regular Expressions 101

Community Patterns

linux log regex

1

Regular Expression
Python

r"
([A-Z][a-z]{2}\s\d\s\d\d:[\d]{2}:[\d]{2})\s([\w]+[\.][\w]+)\s([\w|=]+)\[(\d+)\]:\s.+[\(|\s|\\|\"|\)]
"
g

Description

Matches Date & time in group 1, and the PID in group 4. will update to match computer name and user names too when i can.

Submitted by anonymous - 4 years ago