Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(?:[^:\n]*:){4}\w+\s(?P<logHost>\S+)(?:(\s+\w+-)|(\s+))(?P<tst>(\w+))(?:.*)user\s+(?P<username>\S+)
"
gm

Description

2 different linux logs parsed by one regex

Submitted by anonymous - 4 years ago