The

Log Parser 2.0 tool
lets you run SQL-like queries on log files
of almost any format, and then display the results in a file format
of your choice, in a SQL database, or on a screen. Log Parser is
available as a command-line tool and as a set of scriptable
Component Object Model (COM) objects.