﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>LogViewPlus Support » LogViewPlus Support » Help &amp; Support  » Custom Parser and Messages with Multiple Lines</title><generator>InstantForum 2017-1 Final</generator><description>LogViewPlus Support</description><link>https://www.logviewplus.com/forum/</link><webMaster>LogViewPlus Support</webMaster><lastBuildDate>Sun, 19 Apr 2026 15:10:26 GMT</lastBuildDate><ttl>20</ttl><item><title>Custom Parser and Messages with Multiple Lines</title><link>https://www.logviewplus.com/forum/post/814</link><description>Hi Toby,&lt;br/&gt;&lt;br/&gt;I am trying to write a custom parser for our log files since the default parser has some problems with special cases.&lt;br/&gt;I have a first version of the custom parser, however I have problems correctly parsing log entries with multiple Lines.&lt;br/&gt;&lt;br/&gt;Simplified Example:&lt;br/&gt;&lt;font face="Courier New"&gt;2020.01.01 Test 1&lt;br/&gt;2020.01.02 Test 2.1&lt;br/&gt;Test 2.2&lt;br/&gt;Test 2.3&lt;br/&gt;2020.01.03 Test 4&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;From what I understand from the documentation the &lt;font face="Courier New"&gt;IsLogEnty &lt;/font&gt;method should return &lt;font face="Courier New"&gt;true &lt;/font&gt;when I detect a new log entry. In the above example this would be detecting if the lines start with a date, and in this case return &lt;font face="Courier New"&gt;true&lt;/font&gt;, otherwise false.&lt;br/&gt;&lt;br/&gt;In the &lt;font face="Courier New"&gt;Parse&lt;/font&gt; method then I parse the given logentry line and fill the &lt;font face="Courier New"&gt;LogEntry &lt;/font&gt;class.&lt;br/&gt;&lt;br/&gt;When I run the custom parser it basically works, however in the log entry grid for the second entry I only see the line "&lt;font face="Courier New"&gt;Test 2.1&lt;/font&gt;" and not the lines "&lt;font face="Courier New"&gt;Test 2.2&lt;/font&gt;" and "&lt;font face="Courier New"&gt;Test 2.3&lt;/font&gt;". I can see them in the original entry view, but I would also like to see them in the log entry grid.&lt;br/&gt;&lt;br/&gt;In contrast when I use the Pattern Parser then the log entry grid shows all three lines. How can I achieve this with the custom parser?&lt;br/&gt;&lt;br/&gt;Regards&lt;br/&gt;Andreas</description><pubDate>Wed, 04 Nov 2020 17:18:51 GMT</pubDate><dc:creator>AndreasP</dc:creator></item><item><title>RE: Custom Parser and Messages with Multiple Lines</title><link>https://www.logviewplus.com/forum/post/817</link><description>Glad to hear that is working for you Andreas.&amp;nbsp; Please let me know if you have any further questions or issues.&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Wed, 04 Nov 2020 17:18:51 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: Custom Parser and Messages with Multiple Lines</title><link>https://www.logviewplus.com/forum/post/816</link><description>Hi Toby,&lt;br/&gt;&lt;br/&gt;works perfect. Thanks!&lt;br/&gt;&lt;br/&gt;Andreas</description><pubDate>Wed, 04 Nov 2020 17:16:28 GMT</pubDate><dc:creator>AndreasP</dc:creator></item><item><title>RE: Custom Parser and Messages with Multiple Lines</title><link>https://www.logviewplus.com/forum/post/815</link><description>Hi Andreas,&lt;br/&gt;&lt;br/&gt;This is an excellent question and something that I can see is missing from our documentation.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;You will need to implement the "IFinalizeLogEntry" interface.&amp;nbsp; Your implementation will be something like:&lt;br/&gt;&lt;br/&gt;[code language="c#"]/// &amp;lt;summary&amp;gt;&lt;br/&gt;/// Implementing IFinalizeLogEntry will give us a chance to process any unparsed data.  Unparsed data will&lt;br/&gt;/// automatically be added to the OriginalLogEntry, but you may want to process it further.  Unparsed data&lt;br/&gt;/// will be a collection of all lines where "IsLogEntry" returned false.&lt;br/&gt;///&lt;br/&gt;/// Here, we are adding the unprocessed data to the message for display in the LogViewPlus grid view.&lt;br/&gt;/// &amp;lt;/summary&amp;gt;&lt;br/&gt;/// &amp;lt;param name="entry"&amp;gt;The log entry to be finalized.&amp;lt;/param&amp;gt;&lt;br/&gt;/// &amp;lt;param name="unparsedData"&amp;gt;Any data that could not be parsed.&amp;lt;/param&amp;gt;&lt;br/&gt;/// &amp;lt;param name="result"&amp;gt;The result of the log parse.&amp;lt;/param&amp;gt;&lt;br/&gt;public void FinalizeLogEntry(LogEntry entry, string unparsedData, ParseResult result)&lt;br/&gt;{&lt;br/&gt;&amp;nbsp; if (string.IsNullOrEmpty(unparsedData))&lt;br/&gt;&amp;nbsp;&amp;nbsp;  return;&lt;br/&gt;&lt;br/&gt;&amp;nbsp; entry.Message += unparsedData;&lt;br/&gt;}[/code]&lt;br/&gt;&lt;br/&gt;I will put this in the sample code and update the documentation.&amp;nbsp; Thanks for bringing this to our attention!&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Wed, 04 Nov 2020 13:46:31 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item></channel></rss>