logjoint icon indicating copy to clipboard operation
logjoint copied to clipboard

Request the ability to collapse rows to only show 1 line per row

Open sabrogden opened this issue 11 months ago • 1 comments

Can i request a feature to be able to collapse all lines to a single row? Sometimes the lines are long and I only want to see 1 line then I'll open the message details to view the full message and next/prev through the list.

thanks scott

sabrogden avatar Mar 21 '24 20:03 sabrogden

Did you create the log format in question? If so, you can modify it to show the multiline log messages as you prefer. The format can be edited using the user interface (in Add New Log Source dialog, press Manage formats...) or manually by editing the corresponding *.format.xml file. I'll give examples of what can be put to the *.format.xml file.

Assuming you have a regex capture named body, this code will collapse all line into one row:

<format>
  <regular-grammar>
    <fields-config>
      <field name="Body"><![CDATA[string.Join(" ", body.EnumLines())]]></field>
...

alternatively, this code will show only the first line of a multiline log message:

      <field name="Body"><![CDATA[body.EnumLines().FirstOrDefault(StringSlice.Empty)]]></field>

To be able to see the uncollapsed log, you may want to enable the raw log view

<format>
  ...
  <view-options>
    <raw-view-allowed>yes</raw-view-allowed>
    <preferred-view>normal</preferred-view>
  </view-options>
</format>

sergey-su avatar Apr 06 '24 23:04 sergey-su