locked
how to track list of IP address of visitors by IIS ? RRS feed

  • Question

  • User1080900203 posted
    I have an ASP.NET website hosted in-house server. My website doesn't have any way to track all the visitors. Is there any way to track / get log of all t he external IP addresses of visitors who have visited / currently visiting my website ? By google, i found out that IIS keeps a log and i check the log here: C:\WINDOWS\system32\LogFiles\W3SVC1 By in every log the IP address is same "192.168.40.98", why ? I want external IP address of all the visitors on my website. any help ?
    Monday, June 11, 2012 12:58 PM

All replies

  • User130723362 posted

    You can use a stats application that reads your web logs and provide this information such information in reports or graphs.  SmarterTool offers a free version that would meet your needs.

    http://www.smartertools.com/free-editions.aspx

    Another option is to use Logparser to parse the web logs and gather this information.  Once you install logparser on the server you could use the following example to provide a list of all unique visitors (IP addresses) that accessed the site.

    logparser.exe "SELECT DISTINCT date, c-ip INTO c:\temp\visitors.txt FROM C:\WINDOWS\system32\LogFiles\W3SVC1\logfilename.log" -i:W3C -o:W3C    

    Monday, June 11, 2012 1:43 PM
  • User-76669496 posted

    I assume you're using IIS 7 or 7.5. The Client IP Address (c-ip) is available to be stored in the site log.

    http://technet.microsoft.com/en-us/library/cc754702(v=ws.10).aspx

    Go to the site properties and click Logging. Next to Format click on Select Fields and check Client IP Address (c-ip).

    Monday, June 11, 2012 4:28 PM
  • User-76669496 posted
    For IIS 6 click on the site properties. Go to the Web Site tab. Enable Logging. Click on Properties. Click on Advanced. Click on Client IP Address (c-ip) and then click OK to save. This field is enabled by default on both IIS 6 and IIS 7.
    Monday, June 11, 2012 4:33 PM
  • User1080900203 posted

    I am using IIS6, like I mentioned above, in every log the IP address is same "192.168.40.98"

    I have check the c-ip is checked by default.

    Monday, June 11, 2012 11:26 PM
  • User1080900203 posted
    anyone ?
    Tuesday, June 12, 2012 11:25 AM
  • User130723362 posted

    I think your LAN firewall may be preventing the actual IP's from getting passed through and recorded in the logs.

    Wednesday, July 18, 2012 8:50 PM
  • User990644438 posted
    you need to write some code to achieve this . 1) include a flash cookie in your app ( this will get Ip address) 2) Write some code around this to store the IP ( in DB or in a log file ) adding some refernce to getting client IP address. http://stackoverflow.com/questions/735350/how-to-get-a-users-client-ip-address-in-asp-net
    Friday, July 20, 2012 6:51 AM