in

Utah .NET User Group

Home of Utah's professional .NET developers.

Justin Long's Blog

October 2004 - Posts

  • The Joys of the IIS 6 Log Parser

    This post was recovered from archive.org. It was origionally posted on Wednesday, October 25, 2004

    I recently had the desire to put my IIS logs in a SQL database but I didn’t want to lose the cached hits (since if you use ODBC logging in IIS 6 it won’t log anything that it found in its cache) so I was planning on writing an application to do this until I found the IIS 6 Log Parser in the IIS 6 Resource Kit. This tool is extremely nice. You can just set IIS to log to W3C Extended Log File Format (IISW3C). Then you can use the LogParser.exe command line interface to parse the log file and insert it directly into a SQL database. To do this is as easy as this:

    logparser “select * from mylogfile.log to mydatabase.dbo.mylogfiletable“ -i:IISW3C -o:SQL -driver:“SQL Server“ -server:mysqlserver -username:bob -password:moo

    And that’s it. You now have your entire log file parsed into your SQL database. You can also use this to dump to other formats including XML. And as you could have guessed you can get much more creative with your select query…

    Now that you're thinking “well that’s kind of cool...” (I hope assuming you’ve read this far) this tool also has a COM interface. This means you can easily write applications that use your log files as a data source in any language that can support COM. Seeing how I’m a C# guy I wrote a little test application for this. About 15 min and roughly 30 lines of code later I had a working model that executed a query on a IISW3C format log file and returned the results in a DataTable that I then bound to a DataGrid. From here you should be able to generate all sorts of interesting reports and stats from your web site logs.

    All in all I’m very impressed with this little utility and I though some of you may be interested in my findings…

    You can download my source code for my C# demo application here (Still trying to find the demos, sorry)). You'll also need the IIS 6 Resource Kit to do anything I talked about in this post. You can download that here.

  • DevCon V Thoughts

    This post was recovered from archive.org. It was origionally posted on Saturday, October 23, 2004

    Man do I feel dumb. Spending two days with extremely smart people really puts you in your place. At least now I have a bigger picture of the development community and have new ideas for where I want to be. I guess that’s what happens when you’re surrounded with people like Don Box, Chris Sells, Tim Bray, Chris Anderson, and Sam Ruby among others in such a small intimate environment. I really enjoyed networking with everyone there (Even though I didn’t say much).

    As for the talks I’d have to say Chris Anderson and Don Box had a very interesting choice of colors for there slides. You would link at least Chris would have had better colors since he is the head of the Avalon team and all. As for Don after watching his personality I can completely understand… My favorite talks had to be Jeff Barr’s on Amazon Web Services and Keith Brown’s on Web Service Security. I didn’t really learn anything new and cool from them but I enjoyed listening and how they presented. I was very impressed with the overall quality of the presentations. I learned quite a bit about different XML technologies and where, when and how to use them.

    I also managed to get a (kind of crappy) video of most of Don Box and the others doing there SOAP song. Unfortunately I did miss the first verse though… I’ve got it compressed down to about 7MB in a WMV (From a 50MB AVI). You can download it here (Still trying to recover the video).

    Overall I really enjoyed the conference. I’ll definitely be back next year.

Copyright © 2000-2007, Utah .NET User Group
Powered by Community Server (Commercial Edition), by Telligent Systems