Project

General

Profile

Omit 403 errors that happen via a blocked useragent?

Added by Harry over 14 years ago

How would I have the lighttpd access log omit 403 errors? I block some spammy useragents that fill up my log file I watch passively (I tail -f the access.log), and their spam makes my job hard. I block them, but then they're still on the access.log .... One example, blocked Bittorrent's useragnet, and yet I get this spam in my logs:

IP vhost [03/Nov/2009:18:32:35 +0000] "GET /tracker/Bruno.DVDRip.XviD-****/d-bruno.avi HTTP/1.1" 403 345 "-" "BTWebClient/1840(16688)"

It's no fun really having your logs filled up with spambots trying to get illegal content, so if they are 403'd via useragent, any way I can omit them from my logs? :|

Thanks!


Replies (1)

RE: Omit 403 errors that happen via a blocked useragent? - Added by dirk over 14 years ago

Harry wrote:

How would I have the lighttpd access log omit 403 errors? I block some spammy useragents that fill up my log file I watch passively (I tail -f the access.log), and their spam makes my job hard. I block them, but then they're still on the access.log

You’re watching the log via tail -f … Well, you could do this:

tail -f /var/log/lighttpd/access.log | grep -v "HTTP/1.1\" 403"

Or, if you want not to display HTTP 200 as well, you could use this

tail -f /var/log/lighttpd/access.log | egrep -v "HTTP/1.1\" (200|403)"

lighttpd will still log those messages (that’s the purpose of a log file!), but you don’t have to read through them all the time if you manually watch the log file.

    (1-1/1)