Simple command to "watch" the webserver access log
Fri, Apr 2, 2010
Vote on HN
I am often curious as to what bots are going on my site at any given moment. So much so that I devote one terminal tab to running this script.
save the following as say bot.sh and make it executable :-
watch "grep $1 /path/to/access.log | tail -15"
note: the number after tail can be adjusted depending on your terminal size...
Run it on the server as :-
[user@server ~]# ./bot.sh Googlebot
[user@server ~]# ./bot.sh msnbot
[user@server ~]# ./bot.sh
and so on....
: Better alternative
. Save as bot.sh:-
watch "tail -f /path/to/access.log | grep $1"