LogViewPlus Support

Parsing a tab seperated log file

https://www.logviewplus.com/forum/Topic1303.aspx

By Maarten Mostert - 20 Jan 2022

Hello,
I have a tab-separated log file for which I don't manage to define a correct DSV parser.
Some entries are given below

----
2022-01-20 09:25:22.561    #removed    Smalltalk.UI.MenuView        menuWindowOn:in:    Smalltalk.UI.TransientWindow    class    aPostedMenuIn:
2022-01-20 09:25:22.579    #removed    Smalltalk.UI.MenuView        mapAndStartup:    Smalltalk.UI.MenuController        startUp
2022-01-20 09:25:23.707    #removed    Smalltalk.UI.MenuView        highlightedMenuItemView:    Smalltalk.UI.MenuItemView        resignSelection
2022-01-20 09:25:23.710    #changed    Smalltalk.UI.MenuView        highlightedMenuItemView:    Smalltalk.UI.Controller        sensor
-----
Thanks for any help.
Maarten,
By LogViewPlus Support - 20 Jan 2022

Hi Maarten,

This should be pretty straight-forward for LogViewPlus.  I am not sure the version of the log entries pasted above matches the tab situation you are seeing locally.  I assume that all of the whitespace in these log entries represents a single tab.  If this is the case, I am able to get a pretty good parse with:
%d{yyyy-MM-dd %H:mm:ss.fff}\t%S{Status}\t%S{Class1}\t%S{Class2}\t%S{Class3}\t%S{Class4}\t%m%n



I am using \t here to represent tabs.  LogViewPlus understands this notation - which might help you make things more clear.  Tabs are also supported, so it is up to you.

The only other gotcha I can see is that the number of columns appears to be variable.  It looks like the first row contains an extra column with "aPostedMenuIn:".  All log entries must follow the same format, so a fixed number of columns is needed.  It is best to use %m to capture columns over the fixed size.  In this scenario %m is used to capture "the rest of the log entry".

Hope that helps,

Toby
By Maarten Mostert - 20 Jan 2022

Many thank syou this works 👍
I had been struggling with documentation for a few hours without getting there 🤷‍♂️
Cheers,
Maarten,
By LogViewPlus Support - 20 Jan 2022

Glad to hear that is working for you Maarten.  Please don't hesitate to get in touch if something is not clear.

Thanks,

Toby