Forum Moderators: phranque

Message Too Old, No Replies

Serverside script that compiles a list of IPs with blank UAs?

         

JAB Creations

7:43 pm on Sep 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm looking for a serverside script that will let me scan my access logs and list IP addresses that have no useragent. That way I can look the IP addresses up in known spam lists and block via .htaccess what I don't like. Any suggestions?

John

dcrombie

9:55 am on Sep 9, 2005 (gmt 0)



Using *ix and the standard combined_log format, you can run this from the command-line or put it in a shell script:

awk -F\" '($6 ~ /^-?$/){print}' combined_log ¦ awk '{print $1}' ¦ sort ¦ uniq

;)

JAB Creations

3:56 pm on Sep 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Umm...can I do this on shared hosting? I'm not rich and famous just yet. ;-D