Save the follow shell script as beep.sh, then run:
chmod +x beep.sh
Then run:
tail -f /var/log/apache/access.log | beep.sh GET
The argument to beep.sh is the string you want to match on. So if you wanted to look for HEAD requests instead of GET, run it like this:
tail -f /var/log/apache/access.log | beep.sh HEAD
Or for a particular IP address:
tail -f /var/log/apache/access.log | beep.sh "192.168.0.123"
... You get the idea. Also, your English is quite good
Code:
#!/bin/sh
while [ 1 ]; do
read foo;
echo $foo | grep "$1" > /dev/null 2>&1
if [ $? -eq 0 ]; then
/usr/bin/beep
fi
done