Today I noticed we were getting an expanding measure of spam on one of our sform pages. I was interested to check whether the majority of the client IP locations were the same (in which case I'd simply add them to the IIS IP Restrictions list). To rapidly and effortlessly make sense of this I chose to utilize LogParser.

Other than simply questioning for the page however, I needed to add an extra condition to prohibit lines that originated from a certain  internal IP address that we use for checking.

Here’s a generic version of the query I used:
LogParser.exe -q:on "SELECT * FROM x:\wwwlogs\W3SVC1\u_ex130411.log WHERE cs-uri-stem='/SomePage/' and c-ip<>'10.10.1.100' >c:\temp\PageVisitors.txt"

I needed to see the full logged information for the request, but if I didn’t, I could have very easily just pulled the IP addresses using:
LogParser.exe -q:on "SELECT c-ip FROM x:\wwwlogs\W3SVC1\u_ex130411.log WHERE cs-uri-stem='/SomePage/' and c-ip<>'10.10.1.100' >c:\temp\PageVisitors.txt"

You can see that I'm funneling the outcomes to a content record (the ">c:\temp\PageVisitors.txt" part) so I can without much of a stretch manage the outcomes. You might likewise need to observe that I'm utilizing the "-q:on" flag which runs the command in Quite Mode. In the event that you don't set this banner then LogParser will show comes about one page at once. At the point when funneling to a content record as opposed to the summon prompt window, you clearly can't hit a key for "next page" so without this banner the question will really hang forever if there is more than one page worth of results.

HostForLIFE.eu IIS 8.0 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.