Forum Moderators: phranque

Message Too Old, No Replies

Filtering out my IP address from access_log

How can I filter out my IP so it doesn't show up in my log file?

         

johnquest

4:44 pm on Jan 26, 2003 (gmt 0)

10+ Year Member



I've been searching through the forums to try to find the answer to the question: How can I use .htaccess and/ or mod_rewrite to filter out my IP from being reported in my access_log file? My host is running Apache 1.3.27 and mod-rewrite is installed. I've done some basic expressions to block some bots through .htaccess, but I don't know how to filter my IP from log files or if it's possible? Can someone show me how?

Thanks,

Johnquest

DaveAtIFG

4:03 pm on Jan 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld johnquest! Unfortunately, I don't think you can prevent your IP from being logged. I download my own log files periodically and process them with various analysis tools. Most of them allow a variety of filters.

BjarneDM

5:21 am on Jan 28, 2003 (gmt 0)

10+ Year Member



I'm using this kind of filter in my httpd.conf:

SetEnvIfNoCase Referer "^http://www.website.dk/" local_ref
CustomLog "<path>/logs/referer_log" referer env=!local_ref

thus, for the referer log I only see the external entry points and not the internal. I've been applying the same kind of trick to my other logs to filter out unwanted / superflous information.

Also, see [webmasterworld.com...]

Reflect

4:56 pm on Jan 28, 2003 (gmt 0)

10+ Year Member



I filter my IP out in the log file analyzer program that I use. I just use the "exclude" filtering portion.

Brian

johnquest

6:02 pm on Jan 28, 2003 (gmt 0)

10+ Year Member



"SetEnvIfNoCase Referer "^http://www.website.dk/" local_ref
CustomLog "<path>/logs/referer_log" referer env=!local_ref"

Thanks for this code! The only problem, which I'm still researching, is that I don't have write privileges to my log files. I manage my Web site with a control panel called Plesk, which my host provides for me, but I can't even configure the webalizer config file from plesk to filter my ips. My host is "working on it" to see if there's a workaround. Does anyone else mangae their accounts with Plesk or similar control panels? The problem is getting a host to allow access to the files I need with the right privileges and how Plesk interacts with my file system. Please get back to me with your suggestions.

johnquest

Frank_Rizzo

12:54 am on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I run a cron batch file each night. The batch filters out stuff I don't want from the logs.

All it does is to grep out error messages into seperate files and, grep hits from the messageboard.

It would be easy to modify it to remove entries for your own ip address.

BjarneDM

7:10 am on Jan 31, 2003 (gmt 0)

10+ Year Member



FrankRizzo:
I'm doing that too for all of my logs, but I use a combination of grep, sed, sort and uniq at 3:05 each night.

But as the logs has a tendency to grow beyound all bounds when using the standard settings for these in httpd.conf, I filter out the requests I'm sure of I wont be interested in already at the logging state. This keeps the logfile sizes down to managable levels.

Thus, access_log gets pre-filtered for css, js, gif, jpg, png
referer_log gets pre-filtered for internal links