locked
How to exclude my own IP address from logs? RRS feed

  • Question

  • User145975185 posted

    This may be the wrong forum section to ask this, but I hope someone here can help... 

    I look at my own sites quite a bit, when I am working on them.  This effects the logs.

    I would like to be able to somehow exclude my own IP address from the IIS logs, or remove the entries in some automated way.  I know some NT shell scripting; could the solution lie in that area?

    The IIS server has the same IP address as the machine I am accessing it from, through the internet (using NAT).  This problem is made a bit more complicated by the fact that I have a dynamic IP address that changes everytime I reboot the router.

    Any ideas?  Thanks.

    Friday, June 19, 2009 11:19 PM

All replies

  • User1632528892 posted

    Hi,

    There's no way to do this in IIS but you could use Log Parser to strip out unwanted IP addresses from result sets.

    http://forums.iis.net/default.aspx?GroupID=51

    Regards,

    Saturday, June 20, 2009 2:02 AM
  • User145975185 posted

    I've been meaning to learn how to use Log Parser for quite a while, but I use another log viewing program to view IIS logs.

    Can Log Parser be used to actually process the log files, by stripping out the entries that I want removed, and then saving the processed log files to be viewed in another log viewing program?

    I have just thought, to make it easier for me to know which entries are mine (as I have a dynamic IP) I could access the sites by using an alternative domain name.

    Saturday, June 20, 2009 11:01 AM
  • User1632528892 posted

    Can Log Parser be used to actually process the log files, by stripping out the entries that I want removed, and then saving the processed log files to be viewed in another log viewing program?
     

    Yes, you can do this with Log Parser - you could exclude specific IP addresses and direct the resultant output to a CSV file.

    I have just thought, to make it easier for me to know which entries are mine (as I have a dynamic IP) I could access the sites by using an alternative domain name.
     

    That would also work. In fact you could create a separate web site which points to the same web content and use a completely different host header.

    Regards,

    Saturday, June 20, 2009 2:06 PM
  • User-1292338562 posted

    Hi,

    Since you have a dynamic IP address and you are making the requests directly from your server, you can probably filter out the entries where the client ip address is equal to the server ip  address ('c-ip = s-ip').

    In AdvancedLogging, we've added a Filter feature post-beta that will 'ignore' requests that do not meet the criteria specified.  However, it currently only handles comparing field values to literal values so it will not help with your problem.  I will file a DCR to see if we can compare field values to other field values but it may not make it into this version.

    If you do the separate site idea you mentioned, you could create a filter to ignore your site name so that it will not even get serialized to your log file.

    Thursday, July 2, 2009 3:58 PM
  • User145975185 posted

    Thanks for the information, but I think that Paul's idea to make a separate site that uses the same content is the ideal and easiest solution for me.

    As the log files will be in a different folder, I do not understand why they would still need to be filtered?

    Thursday, July 2, 2009 8:29 PM
  • User-1292338562 posted

    Hi synapse,

    I missed your question when you originally posted.  I was reviewing your post to let you know that we just released the RTW version of Advanced Logging in case you wanted to check it out.  Were you able to get your issue resolved by using a separate domain name?

    To answer your question, if your log files are in separate folders than filtering will be unnecessary.  However, if you are using global log files at the server level (ie all requests to all sites are rolled into a single file), then filtering could help you log only the requests that you care about.  You can take a look at the following walkthrough for more information:  http://learn.iis.net/page.aspx/692/advanced-logging-for-iis-70---log-filtering/

    Monday, October 19, 2009 7:26 PM
  • User145975185 posted
    Hi Bobby. I have been using a separate domain name and site to the same files, for my own access, but Advanced Logging looks interesting to try. Does it work with IIS 7.5? Thanks.
    Monday, October 19, 2009 8:51 PM
  • User-1292338562 posted

    Yes, it will work with IIS 7.5.

    Tuesday, October 20, 2009 1:53 PM