IIS Log Parser?

Here developers can talk about how to write a Parser for LogMX

Moderator: admin

Post Reply
pedromatic
Posts: 1
Joined: Wed Oct 05, 2011 8:12 pm

IIS Log Parser?

Post by pedromatic » Wed Oct 05, 2011 8:16 pm

Does anyone have a Parser for the w3c extended log file format used in IIS?

I tried creating a pattern, but couldn't get it to work.

Thank you

admin
Site Admin
Posts: 419
Joined: Sun Dec 17, 2006 10:30 pm

Re: IIS Log Parser?

Post by admin » Wed Oct 05, 2011 9:39 pm

Hello,

Here is a simple Log4jPattern for IIS 7.5:

Code: Select all

%d{yyyy-MM-dd HH:mm:ss} %u{s-IP} %c %m - %u{port} %u{user} %u{c-IP} %u{agent} %p %u{sub-status} %u{w32-status} %u{time-taken}
But I suggest you to use a Java Parser Class instead, which is more powerful than Patterns, in order to reformat all these fields (e.g. concatenate several fields in the "Message" field, ignore some comments line in log file, handle all HTTP Status codes,...)

Also, don't forget to:
  • set the right level and color for the new log levels based on HTTP Status (e.g 200 => INFO, 300 => WARNING, 400 => ERROR)
  • set the right settings for your Log4j tags:
Image

Feel free to post here if you have trouble using such a Log4jPattern Parser or a JavaClass Parser.
Xavier.

Post Reply