flipchan / logcheck

A unique amount of ip addresses counter for web server access files
The Unlicense
0 stars 0 forks source link

autodetect log format #1

Open flipchan opened 4 years ago

flipchan commented 4 years ago

different log format on different web servers Need feature to auto detect the type of log format

flipchan commented 4 years ago

Nginx

0.0.0.0 - - [15/Oct/2019:19:41:46 +0000] "GET / HTTP/1.1" 200 396 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"

Hiawatha

0.0.0.0|Tue 25 Dec 2018 21:55:14 +0100|200|3569|GET /index.xml HTTP/1.1|https://example.com/|Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Firefox/60.0|Host: example.com|Accept: text/css,*/*;q=0.1|Accept-Language: en-US,en;q=0.5|Accept-Encoding: gzip, deflate, br|Connection: keep-alive

httpd

example.com 0.0.0.0 - - [03/May/2020:00:00:53 +0300] "GET /index.xml HTTP/1.1" 200 168795
example.com 0.0.0.0 - - [03/May/2020:00:01:10 +0300] "GET /robots.txt HTTP/1.1" 404 0
flipchan commented 4 years ago

write regexes for it all

flipchan commented 4 years ago

https://regex101.com/ regex helper tool