Skip to content

Add Nginx Log to IPBan #147

Answered by fahmiegerton
fahmiegerton asked this question in Q&A
Discussion options

You must be logged in to vote

Nevermind, this is the correct regex

(?<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] (((\"(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD|TRACE|CONNECT|[.*\\x.*]) )(?<url>.+)(http\/1\.(1|0)"))|.*\\x.*) (?<statuscode>(301|4(44|03|00))) (?<bytessent>\d+) (["](?<refferer>(\-)|(.+))["]) (["](?<useragent>.+)["])

I just remove the P on ?p<name>

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by fahmiegerton
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants