Welcome to MSDN Blogs Sign in | Join | Help

Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

A number of years ago, the product team I was on spent a lot of team analyzing large log files. These log files contained thousands of lines of output tracing what the code was doing, what its current state was, and gobs of other diagnostic information. Typically, we were only interested in a handful of lines - but had no idea which ones at first. Often one would start by searching for a generic error message, get some information from that, search for some more specific information, obtain more context, and continue on in that manner until the problem was identified. It was usually the case that interesting lines were spread across the entire file and could only really be understood when viewed together - but gathering them all could be inconvenient. Different people had different tricks and tools to make different aspects of the search more efficient, but nothing really addressed the end-to-end scenario and I decided I'd try to come up with something better.

TextAnalysisTool was first released to coworkers in July of 2000 as a native C++ application written from scratch. It went through a few revisions over the next year and a half and served myself and others well during that time. Later, as the .NET Framework became popular, I decided it would be a good learning exercise to rewrite TextAnalysisTool to run on .NET as a way to learn the Framework and make some architectural improvements to the application. TextAnalysisTool.NET was released in February of 2003 as a fully managed .NET 1.0 C# application with the same functionality of the C++ application it replaced. TextAnalysisTool.NET has gone through a few revisions since then and has slowly made its way across parts of the company. (It's always neat to get an email from someone in a group I had no idea was using TextAnalysisTool.NET!) TextAnalysisTool.NET is popular enough among its users that I started getting requests to make it available outside the company so that customers could use it to help with investigations.

The effort of getting something posted to Microsoft.com seemed overwhelming at the time, so TextAnalysisTool.NET stayed internal until now. With the latest request, I realized my blog would be a great way to help internal groups and customers by making TextAnalysisTool.NET available to the public!

TextAnalysisTool.NET Demonstration

You can download the latest version of TextAnalysisTool.NET by clicking here (or on the image above).

In the above demonstration of identifying the errors and warnings from sample build output, note how the use of regular expression text filters and selective hiding of surrounding content make it easy to zoom in on the interesting parts of the file - and then zoom out to get context.

Additional information can be found in the TextAnalysisTool.NET.txt file that's included in the ZIP download (or from within the application via Help | Documentation). The first section of that file is a tutorial and the second section gives a more detailed overview of TextAnalysisTool.NET (excerpted below). The download also includes a ReadMe.txt with release notes and a few other things worth reading.

The Problem: For those times when you have to analyze a large amount of textual data, picking out the relevant line(s) of interest can be quite difficult. Standard text editors usually provide a generic "find" function, but the limitations of that simple approach quickly become apparent (e.g., when it is necessary to compare two or more widely separated lines). Some more sophisticated editors do better by allowing you to "bookmark" lines of interest; this can be a big help, but is often not enough.

The Solution: TextAnalysisTool.NET - a program designed from the start to excel at viewing, searching, and navigating large files quickly and efficiently. TextAnalysisTool.NET provides a view of the file that you can easily manipulate (through the use of various filters) to display exactly the information you need - as you need it.

Filters: Before displaying the lines of a file, TextAnalysisTool.NET passes the lines of that file through a set of user-defined filters, dimming or hiding all lines that do not satisfy any of the filters. Filters can select only the lines that contain a sub-string, those that have been marked with a particular marker type, or those that match a regular expression. A color can be associated with each filter so lines matching a particular filter stand out and so lines matching different filters can be easily distinguished. In addition to the normal "including" filters that isolate lines of text you DO want to see, there are also "excluding" filters that can be used to suppress lines you do NOT want to see. Excluding filters are configured just like including filters but are processed afterward and remove all matching lines from the set. Excluding filters allow you to easily refine your search even further.

Markers: Markers are another way that TextAnalysisTool.NET makes it easy to navigate a file; you can mark any line with one or more of eight different marker types. Once lines have been marked, you can quickly navigate between similarly marked lines - or add a "marked by" filter to view only those lines.

Find: TextAnalysisTool.NET also provides a flexible "find" function that allows you to search for text anywhere within a file. This text can be a literal string or a regular expression, so it's easy to find a specific line. If you decide to turn a find string into a filter, the history feature of both dialogs makes it easy.

Summary: TextAnalysisTool.NET was written with speed and ease of use in mind throughout. It saves you time by allowing you to save and load filter sets; it lets you import text by opening a file, dragging-and-dropping a file or text from another application, or by pasting text from the clipboard; and it allows you to share the results of your filters by copying lines to the clipboard or by saving the current lines to a file. TextAnalysisTool.NET supports files encoded with ANSI, UTF-8, Unicode, and big-endian Unicode and is designed to handle large files efficiently.

I maintain a TODO list with a variety of user requests, but I thought I'd see what kind of feedback I got from releasing TextAnalysisTool.NET to the public before I decide where to go with the next release. I welcome suggestions - and problem reports - so please share them with me if you've got any!

I hope you find TextAnalysisTool.NET useful as I have!

Published Thursday, June 21, 2007 5:47 PM by Delay
Filed under:

Attachment(s): TextAnalysisTool.NET.gif

Comments

# Rob’s World » TextAnalysisTool.NET

Wednesday, June 27, 2007 6:05 AM by Rob’s World » TextAnalysisTool.NET

# Loganalyse für Dummys

Friday, August 10, 2007 2:05 PM by Franz Pentenrieder's Weblog

Wir hatten auf unserem Server mal wieder ein kleines Spamproblem, wie man Logfiles analysiert und was

# re: Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

Sunday, August 26, 2007 9:11 PM by brian.cook@bnsf.com

Can you or would you post code snips?

# re: Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

Monday, August 27, 2007 1:11 PM by Delay

Brian,

Code snips of what?

# re: Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

Monday, September 17, 2007 1:13 PM by carehart

Dave, nice tool. Thanks. It's not clear from the readme if you'd prefer questions by email or here on the blog. Since others may have the same question, I'll ask mine here. I don't see how to set markers. Even in the sample file which has them set, I'm not seeing how they were set. I've tried right-clicking a line, I've looked on the menu. I fear I'll hear I've missed something obvious.

And for those who may miss it if they don't read the help file (highly recommended), you move among filter-selected items with space and shift-space. Dave, since some may never think of that, it might be nice to add that as a menu option (along with setting markers) for those who may look there rather than the docs.

But otherwise, nice tool. Thanks for sharing.

# re: Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

Monday, September 17, 2007 1:41 PM by Delay

carehart,

Thanks for the kind words and suggestions! Markers are set with the Ctrl+1-8 key combination [line 154 of the documentation, but I know it's easy to miss :) ]. They support the same "filter ID" key scrolls to next matching line/Shift+"filter ID" scrolls to previous matching line behavior that filters do. This behavior works like the more general Space/Shift+Space behavior you call out, but applies only to the specified filter/marker, making it easy to cycle through all the marker '1' items (or filter 'c' items, etc.). Point taken on the (lack of) discoverability here, thanks for bringing it up! My TODO list has been updated. :)

# re: Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

Sunday, September 23, 2007 8:39 PM by ef2e2f2e

very interesting tool. could be a good idea to add some useful functionalities lika events, db support, etc. want you add me in the development roaadmap?  let's create a community of interested people.

# re: Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

Monday, September 24, 2007 1:20 PM by Delay

ef2e2f2e,

Thanks for the note! I've got a TODO list of potential future features, so if you'd like to send me a list of ideas via the contact form of this blog (http://blogs.msdn.com/delay/contact.aspx), I'd be happy to add them to my list!

# re: Powerful log file analysis for everyone [Releasing TextAnalysisTool.NET!]

Tuesday, November 20, 2007 5:35 PM by webmat

Wow! That's one hell of a nice tool! I love it :-) I particularly the keyboard shortcuts.

Are you considering making this tool open source? That would be truly awesome. Nothing like open source to dispatch those todo list items. Or to get unexpected feature contributions, for that matter.

Anyway, thanks a lot for making this app available as it is. Truly appreciated!

Anonymous comments are disabled
 
Page view tracker