Wednesday, March 26, 2014

Log Parsing

I love log files, they have so much value.
I work with IIS sites a lot and IIS log files are wonderful things. I also enjoy looking at Squid, Apache, and ELB logs. Really, I enjoy it.

I have two tools I especially love for IIS log file parsing.
This Log Parser is amazing; it gives you SQL syntax for quering text files including IIS log files or more generally CSV files. I think it does more but those two are the ones I'm most often dealing with. It's really fast at processing too.
The other tool I love for taking a peek at IIS log files is Microsoft Excel. Excel is a wonderful bit of software and doesn't mind chewing on large log files. I import them as data from a text file, space delimited, and then format the whole thing as a table. This gives me filtering and sorting on the columns which allows me to answer questions like 'which request with a response code in the 200s takes the longest', 'which requests are 404-ing most often'.

Alongside graphing solutions (I'm a fan of Graphite) parsing the log files is powerful; the graph will show some weirdness such as an increase in average response time, or a large number of errors and the log files will give you the details. Hopefully you'll find an answer to the deviant behaviour there.
I've found this tutorial to be an excellent introduction to Graphite and it has some tutorials on setting it up and configuring it.

In general I find that graphing solutions will give you a question, the logs will give you the answer.


Thursday, March 20, 2014

Management Studio Feature Request

I spend quite a bit of time in Sql Server Management studio in bursts, at the moment I'm there quite a lot because I'm creating an SSIS package.
I find that I create tons of tabs which roughly group together a bunch of related, useful queries. They're nothing I want to keep long-term so I seldom save them but after a while I forget which bit of sql is in which tab. Things get worse when I have more tabs than can be displayed and the one I want is scrolled off the screen somewhere; "Hmm, was that query in SQLQuery20? *click* Nope, not that one. What is this stuff?".

I'd love to have two features here:

  1. Rename a tab without having to save it. I really should save it but sometimes I really only need them for an hour or two, I don't want the clean-up afterwards;
  2. Save a whole session for later. So say I'm working on the SSIS project, I have lots of tab open which are useful for now. But then I need to do something else, or management studio is running slowly so I want to close it and re-open it later. Wouldn't it be cool if I could save the whole session as it is and close management studio. Then when I get back to it I can re-open my SSIS project and have it reconnect to the databases I had, re-open all the tabs back to how they were including their names and positions;
That'd make me happy.