Announcement

Collapse
No announcement yet.

LogMatch - ignore lines with certain type and message?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    LogMatch - ignore lines with certain type and message?

    Hi Steve, is there a way to tell LogMatch to ignore a log entry that includes a certain phrase and type? (I have zero Regex skills and googling "Regex ingore" didn't make me any smarter

    This would make it easy to ignore transient errors I know about but can't sold

    For example, I would like it to match "Error" but not if the log entry is (I figure this list will grow as I pay more attention to my log

    • Type="CAM" & Message= "Error with request: The remote server returned an error: (503) Server Unavailable"
    • Type="Autelis" & Message= "ERROR WebException: Timeout The operation has timed out"
    • Type=
    weatherXML Error" & Messasage= "checkForNewAreas: Object reference not set to an instance of an object."

    Thanks!

    #2
    Originally posted by mda View Post
    Hi Steve, is there a way to tell LogMatch to ignore a log entry that includes a certain phrase and type? (I have zero Regex skills and googling "Regex ingore" didn't make me any smarter

    This would make it easy to ignore transient errors I know about but can't sold

    For example, I would like it to match "Error" but not if the log entry is (I figure this list will grow as I pay more attention to my log

    • Type="CAM" & Message= "Error with request: The remote server returned an error: (503) Server Unavailable"
    • Type="Autelis" & Message= "ERROR WebException: Timeout The operation has timed out"
    • Type=
    weatherXML Error" & Messasage= "checkForNewAreas: Object reference not set to an instance of an object."

    Thanks!
    I'm a bit of a RegEx novice myself but you can do this.

    You should try something like:

    ^(?!.*The remote server returned an error)(.*Error.*)

    That should match a log message containing 'Error', anywhere within it, but not if it also contains 'The remote server returned an error'. A slight downside is that the whole of the message will be highlighted. The reason is that I have the '.*' prefix and suffix to Error within the capture group to capture the whole message. If you only capture the word then the RegEx.Replace method I use to highlight the text replaces the whole message with just the captured part. There is probably a way around this but I would have to do more experimenting to find out how.

    https://regex101.com is a good tool for testing RegEx

    Let me know how you get on.

    Steve

    Comment


      #3
      worked great, thanks!

      (and regex101.com is my new best friend

      Comment

      Working...
      X