This is 2017, and LogParser is still closed. Moreover, all the tools provided by cloud solutions seem to force analysis of IIS logs in the past. But since I also deal with legacy applications, I wrote this simple parser using the .NET kernel.
using System; using System.IO; using W3CParser.Extensions; using W3CParser.Instrumentation; using W3CParser.Parser; namespace W3CParser { class Program { static void Main(string[] args) { var reader = new W3CReader(File.OpenText(args.Length > 0 ? args[0] : "Data/foobar.log")); using (new ConsoleAutoStopWatch()) { foreach (var @event in reader.Read()) { Console.WriteLine("{0} ({1}):{2}/{3} {4} (bytes sent)", @event.Status.ToString().Red().Bold(), @event.ToLocalTime(), @event.UriStem.Green(), @event.UriQuery, @event.BytesSent); } } } } }
Source code: https://github.com/alexnolasco/32120528
source share