I am looking for samples on how to parse IIS log files. I'm just getting started, and rather than search for site, I want personal recommendations about sample sites, sample code or a good book to get started down this learning path.
2 Answers
Might it be easier to work with LogParser?
-
Thanks for the pointer, I am familiar with LogParser, I heard you can use PowerShell for parsing logs as well, need some samples to get started. Mar 4, 2010 at 18:45
When I don't have logparser available, I've had luck with Select-String like in the example from http://mohundro.com/blog/2006/11/06/find-in-files-with-powershell/ Select-String uses regular expressions by default, so it is very powerful.
Get-ChildItem -Recurse -Include *.* | Select-String "text to search for"
I've also used the WebAdministration Module for Powershell to find the right log directory for the sites.