2,280 pts.
 Need help with Powershell script to remove entries from IIS log file
Can anyone provide a sample Powershell script that can loop through a list of IIS log files and parse out certain lines based on a pattern? We need to parse out all lines that have GSA as our Google Search Appliance is crawling our site and artificially driving up our Webtrends web analytics page view count.

Software/Hardware used:
Windows Server 2008
ASKED: January 19, 2012  1:42 AM
UPDATED: February 28, 2012  11:26 AM

Answer Wiki:
Not a PowerShell script, but would the Log Parser 2.2. utility work here? Download here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=24659 It is pretty simplistic, but here is the Powershell command/script that I created to parse out unwanted lines from an IIS log file "select-string -path iislogfile.log -pattern gsa-crawler, 146.189.1.2 -notmatch | ForEach-Object {$_.Line}". We needed this command because our Webtrends web analytics product is licensed by page view count and Google Search Appliance (GSA) causes real page views that falsely count towards our licensed page view count and Webtrends Support told us to "parse out the GSA crawler lines".
Last Wiki Answer Submitted:  June 19, 2013  2:26 pm  by  Chris Leonard   3,170 pts.
All Answer Wiki Contributors:  Chris Leonard   3,170 pts. , Ben Rubenstein   2,060 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thanks Brubensteintt. Log Parser will do exactly what I need it to to plus more.! – Tech Talker

 2,280 pts.