Skip unused fields

Here developers can talk about how to write a Parser for LogMX

Moderator: admin

Post Reply
column
Posts: 5
Joined: Thu Aug 13, 2015 8:24 pm

Skip unused fields

Post by column »

Hello,

I have simple parser that uses several fields - ID, Timestamp, Emitter,Message. Other fields are not useful for me. Each time I open file I must uncheck not used fields. Is it somehow possible to ask parser to remember unchecked fields.
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Skip unused fields

Post by admin »

Hello,

You can achieve this through a couple of different ways, but first let me ask you: when you say "simple parser", are you referring to the Parser type named "SimpleParser"? If the answer is yes, then options 1.x below are not for you, go directly to option 2:
  • Option 1: Ask the Parser to ignore these fields. Multiple options are possible, depending on the type of Parser you're using:
    1. Log4j/Logback Pattern Parser: when editing your parser, click on the button "Tag settings" at the right, then check the box in the column "Ignore", for each field to ignore
    2. Regex Parser: simply use .* instead of (.*) for the field(s) to ignore
    3. JavaClass Parser: it depends on how you wrote your code, but basically, don't include the field(s) in the list returned by "getUserDefinedFields()"
  • Option 2: Ask the log entries table to remember the columns to display by default: remove the field(s) you don't want to see (using the popup menu through a right-click on the log entries table header, in the main window), then right-click on the table header again, then pick item "Save these columns size & state as default settings" (another useful tip is too also use the item right after this one in the menu: "Columns default settings" to edit the default view more precisely).

Please let me know if it worked!

Xavier
Post Reply