We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Exclude Certain IPs from log files [Answered]RSS

3 replies

Last post Sep 19, 2007 11:25 PM by steve schofield

  • Exclude Certain IPs from log files

    Sep 17, 2007 12:12 PM|fast74|LINK

    Hi,

    Is it possible to have IIS6 completely exclude certain IP addresses or ranges from the log files?

    I have a web site monitor that requests certain pages to ensure the site is up and running but these are interfering with the stats. It would be much simplier if the monitoring server's IP wasn't written to the logs.

    Thanks,

    Shane
     

  • Re: Exclude Certain IPs from log files

    Sep 17, 2007 12:36 PM|KristoferG|LINK

    Hi Shane,

    That's a great question!

    No, you cannot tell IIS to not log requests that are coming from a certain IP address. You can however exclude certain folders and/or files from being logged. So if your monitor application is requesting the same file every time, you can exclude this file from logging, and requests for this file (no matter from who/what) will not be logged.

    The other option is to exclude your monitoring server's IP address when you analyze the log files. Any decent log analyzer should be able to do this (many people don't want to include requests from indexer applications such as googlebot in their reports).

    A third option (if your log analyzer cannot do the above) is to use Log Parser and remove any entries originating from the monitoring server's IP address.

    Hope this helps!

    Kristofer Gafvert

    http://www.it-notebook.org
  • Re: Exclude Certain IPs from log files

    Sep 18, 2007 04:48 AM|fast74|LINK

     thanks Kristofer,
    I'm going to re-organise the files into a single test folder and exclude that from the log files.

     Thanks

    Shane
     

  • Re: Exclude Certain IPs from log files

    Sep 19, 2007 11:25 PM|steve schofield|LINK

    I've ran into this before, our monitoring programs were adding un-needed entries, we just un-checked them from being logged.  That greatly reduced our logs.  I also would recommend you look at what is being logged, in IIS every folder, vdir is being logged.  Do you really need images, CSS, or other folders that do not need to be logged.  I used to run aspfree.com, my logs were rather large, after not logging images, css and other JS types, my logs went down 50%.   Of course I had a few images on my pages, but it helped only record what I needed. 

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget