Need help with Powershell script to remove entries from IIS log file

2310 pts.
Tags:
Scripting
Windows PowerShell
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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”.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TechTalker
    Thanks Brubensteintt. Log Parser will do exactly what I need it to to plus more.! - Tech Talker
    2,310 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following