Announcement

Collapse
No announcement yet.

Alert plugin - Regex question

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

  • Alert plugin - Regex question

    Hi all,

    In Alert plugin I have a global alert set on Destination connector errors over all my channels. Now I'm trying to avoid triggering alerts when ${error} looks like :

    Destination Connector (Channel Writer) error ERROR MESSAGE: Error routing message to channel id: d4d2f24c-7a39-4ae6-a204-00c029f5053e
    com.mirth.connect.donkey.server.channel.ChannelExc eption
    at com.mirth.connect.donkey.server.channel.SourceConn ector.dispatchRawMessage(SourceConnector.java:187)
    at com.mirth.connect.server.controllers.DonkeyEngineC ontroller.dispatchRawMessage(DonkeyEngineControlle r.java:1067)
    at com.mirth.connect.connectors.vm.VmDispatcher.send( VmDispatcher.java:157)
    at com.mirth.connect.donkey.server.channel.Destinatio nConnector.handleSend(DestinationConnector.java:82 2)
    at com.mirth.connect.donkey.server.channel.Destinatio nConnector.run(DestinationConnector.java:669)
    at java.lang.Thread.run(Unknown Source)

    These alerts are triggered when a channel tries to send a message to another channel while paused/stopped. In my context this is a "false" alert and would like to ignore it.

    While not very familiar with Regex, I'm trying to build an expression, and with help of online tools I came up with the following :

    /^(?!.*Error routing message).*$/s

    It works fine on online tools but in the Alert plugin. Am I missing something? 's' flag not recognized? I had a look at previous posts, some mentioned those kind of approaches with lookaheads but none helped.

    Thanks very much for helping...
    Tom
    Tom

  • #2
    I am working on the exact same thing and will let you know if I have any success.
    Best,

    Kirby

    Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

    Appliance Version 3.11.4
    Mirth Connect Version 3.8.0
    Java Version 1.6.0_45-b06
    Java (64 bit) Version 1.6.0_45-b06
    Java 7 (64 bit) Version 1.7.0_151-b15
    Java 8 (64 bit) Version 1.8.0_181-b13
    PostgreSQL Version 9.6.8

    Comment


    • #3
      The alert RegEx field only allows you to supply the pattern, without any flags/attributes. In fact, you don't even want to include the slashes in that field, only the pattern itself.

      Comment


      • #4
        So how would you filter out only one specific alert? Using Tom's example, how could you filter out just the "Error routing message" alerts?
        Best,

        Kirby

        Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

        Appliance Version 3.11.4
        Mirth Connect Version 3.8.0
        Java Version 1.6.0_45-b06
        Java (64 bit) Version 1.6.0_45-b06
        Java 7 (64 bit) Version 1.7.0_151-b15
        Java 8 (64 bit) Version 1.8.0_181-b13
        PostgreSQL Version 9.6.8

        Comment


        • #5
          Originally posted by kirbykn2 View Post
          So how would you filter out only one specific alert? Using Tom's example, how could you filter out just the "Error routing message" alerts?
          I'm far from a RegEx expert (very far), but if you can't match it without using modifiers/flags, it may currently be impossible. There's an open JIRA issue to add this ability: http://www.mirthcorp.com/community/i...wse/MIRTH-4067.

          Comment


          • #6
            You're close, just have to use [\s\S] instead of a period.

            Code:
            ^((?!Error routing message)[\s\S])*$
            Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

            Nicholas Rupley
            Work: 949-237-6069
            Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


            - How do I foo?
            - You just bar.

            Comment


            • #7
              That works!

              Thank you so much, I've been struggling with this one for a while...

              Tom
              Tom

              Comment

              Working...
              X