How to process optional columns in DsvParser


Author
Message
soko
soko
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 3, Visits: 5
Hi,

I'm using the latest version of LogViewPlus and I'm having trouble finding the right settings for a DsvParser... or even maybe I need a different one.

Here's my log data:
12399|2025-10-16T02:26:17.4405537+00:00|INFO|37|Lifetime|Application is shutting down...
12401|2025-10-16T02:26:17.4581051+00:00|DEBUG|46|Host|Hosting stopping
12403|2025-10-16T02:26:17.4718160+00:00|DEBUG|40|Host|Hosting stopped
59|2025-10-16T02:26:41.4117132+00:00|INFO|2|VirusScannerService|VirusScannerService|TestIfItIsWorking|Starting Test...
61|2025-10-16T02:26:41.4138900+00:00|INFO|2|VirusScannerService|VirusScannerService|.ctor|Starting to initialise AMSI


I use this CsvParser: %s|%d{yyyy-MM-ddT%H:mm:ss.fffffffzzzz}|%p|%t|%c|%m%n

as a workaround but the last two lines only show "VirusScannerService" as message and not the full text "VirusScannerService|TestIfItIsWorking|Starting Test..."

What I really want is to somehow tell the parser there are optional columns and the last column is the message.
So for the first three lines the parser of above works fine.
But for the last two it should be: %s|%d{yyyy-MM-ddT%H:mm:ss.fffffffzzzz}|%p|%t|%c|%S{class}|%S{method}|%m%n

Is something like this possible? Or do I have to use a different parser when some columns are missing in some lines?

May I even need to use a https://www.logviewplus.com/docs/custom_parsers.html or a https://www.logviewplus.com/docs/post_processors.html

At the moment I'm using this RegexParser as it gives me the optional columns in the message:
 (?<sequence>\d+)\|(?<date>[0-9T:\.\+\-]+)\|(?<level>[A-Z]+)\|(?<thread>\d+)\|(?<logger>[^|]+)\|(?<message>.*)$

thanks
Soko

PS: There is also the possibility the message has multiple lines like shown below. But it seems this seems to work with my current RegExParser:
449|2025-10-16T11:20:51.1474936+00:00|DEBUG|11|Query|Compiling query expression:
'DbSet<Project>()
  .Include(p => p.Users)
  .ThenInclude(pu => pu.User)
  .OrderBy(p => p.Code)'
451|2025-10-16T11:20:51.1548535+00:00|DEBUG|11|Query|Including navigation: 'Project.Users'.

Edited Last Week by soko
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Login

Explore
Messages
Mentions
Search