Regular Expressions 101

Community Patterns

1...56789...877

nginx log parser

1

Regular Expression
Python

r"
^([^ ]*) - ([^ ]*) \[(.*)\] \"([^ ]*) ([^ ]*) ([^ ]*)\" (-|[0-9]*) (-|[0-9]*) \"(.+?|-)\" ([^ ]*|-) ([^ ]*|-) ([^ ]*|-) \"(.+?|-)\" \"(.+?|-)\" \"(.+?|-)\"$
"

Description

separate nginx log into database table-style fields

Submitted by wgzhao - 9 years ago