httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josu Lazkano <josu.lazk...@barcelonamedia.org>
Subject [users@httpd] Filter IP on logs
Date Wed, 29 Jun 2011 09:09:05 GMT
Hello list, this is my first mail on the list.

I am configuring Apache server with some vhost, I configured the logs on each vhost this way:

ErrorLog /var/www/domain1/log/error.log
LogLevel warn
CustomLog /var/www/domain1/log/access.log combined

I am monitoring all vhost with Monit and Mom and I have lots of lines on the access.log:

$ cat /var/www/domain1/log/access.log | grep "Mon_IP"
Mon_IP - - [29/Jun/2011:10:54:08 +0200] "GET / HTTP/1.1" 200 8772 "-" "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1)"
Mon_IP - - [29/Jun/2011:10:56:08 +0200] "GET / HTTP/1.1" 200 8772 "-" "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1)"
Mon_IP - - [29/Jun/2011:10:58:08 +0200] "GET / HTTP/1.1" 200 8772 "-" "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1)"
Mon_IP - - [29/Jun/2011:11:00:08 +0200] "GET / HTTP/1.1" 200 8772 "-" "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1)"
Mon_IP - - [29/Jun/2011:11:02:08 +0200] "GET / HTTP/1.1" 200 8772 "-" "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1)"
Mon_IP - - [29/Jun/2011:11:04:08 +0200] "GET / HTTP/1.1" 200 8772 "-" "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1)"
...

$ cat /var/www/domain1/log/access.log | grep "Monit_IP"
Monit_IP - - [29/Jun/2011:11:01:07 +0200] "GET /monit/token HTTP/1.1" 200 269 "-" "monit/5.2.1"
Monit_IP - - [29/Jun/2011:11:02:07 +0200] "GET /monit/token HTTP/1.1" 200 269 "-" "monit/5.2.1"
Monit_IP - - [29/Jun/2011:11:02:07 +0200] "GET /monit/token HTTP/1.1" 200 269 "-" "monit/5.2.1"
Monit_IP - - [29/Jun/2011:11:03:07 +0200] "GET /monit/token HTTP/1.1" 200 269 "-" "monit/5.2.1"
Monit_IP - - [29/Jun/2011:11:03:07 +0200] "GET /monit/token HTTP/1.1" 200 269 "-" "monit/5.2.1"
Monit_IP - - [29/Jun/2011:11:04:07 +0200] "GET /monit/token HTTP/1.1" 200 269 "-" "monit/5.2.1"
Monit_IP - - [29/Jun/2011:11:04:07 +0200] "GET /monit/token HTTP/1.1" 200 269 "-" "monit/5.2.1"
...

How can I delete both IPs from my logs?

Is it possible to do this?

Thanks for all your help and best regards.

Mime
View raw message