Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sabrogden opened this issue Mar 21, 2024 · 1 comment
Open

Comments

@sabrogden
Copy link

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

@sergey-su
Copy link
Owner

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants