Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r'
(?P<ip>\S*) (?P<firstseperator>-) (?P<userid>\S+|-) (?P<timestamp>\[\S+ \S+) "(?P<URL>\S+|\S+ \S+ [A-Z/0-9.]+)" (?P<http_code>[0-9]+) (?P<guessing_size>[0-9]+) "(?P<endpoint_url>\S+|-)" "(?P<client_and_version>[a-zA-Z/0-9.-]+)
'
gm

Description

Splits NGINX logs into named groups

Submitted by Simon - 2 years ago