Service Operations Insight

  • 1.  Event Builder error for regex on APM Connector

    Posted Aug 16, 2017 01:06 AM

    Event Pattern: matches (MdrElementID, '\S{3}\d{3}AL')

     

    When using the regex in the Event GUI to search for events, I get the events returned as expected. When I then build an Enrichment policy based on the event search and want to deploy it to the APM connector, I get an error: UNKNOWN_ERROR - [QueryParms.ConvertToEIPolicy; Validating Policy failed, see log files].

     

    I found the following error in the logs:

    ERROR [http-bio-0.0.0.0-7090-exec-99209] builder.PatternBuilder.getFieldValue(1394)  - [Error: illegal escape sequence: S]
    [Near : {... "(?s).*\S{3}\d{3}AL.*" ....}]

     

    Why would there be a problem with the '\' when trying to deploy the policy?

     

    I will see if I can test this same regex on another Connector and see if I hit the same issue.



  • 2.  Re: Event Builder error for regex on APM Connector

    Posted Aug 16, 2017 01:56 AM

    Getting the same error in my Test Environment with the SNMP Connector.



  • 3.  Re: Event Builder error for regex on APM Connector

    Posted Aug 16, 2017 08:37 AM

    Hi Madelaine,

     

    When googling regex "Error: illegal escape sequence" there are hits explaining that double blackslashes are required
    for drools which is used in SOI when deploying policies.

     

    e.g.

     


    https://issues.jboss.org/browse/JBRULES-2886

     

    There other hits where several blackslashes need to be used

     

    e.g.

     

    https://forums.mulesoft.com/questions/2395/mule-dealing-with-special-characters.html

     

    Is there any improvement if you add (an) extra backslash(es) in the regex?

     

    Thanks,

     

    Paul



  • 4.  Re: Event Builder error for regex on APM Connector

    Broadcom Employee
    Posted Aug 16, 2017 09:47 AM

    Hi Madelaine,

    I had this issue some time back. You need to use 4 slashes for the escape character. Once you save and deploy the policy you'll notice the Event pattern field shows 2 slashes which is ok. If you need to edit the policy at some point you have to add the extra 2 slashes (to make it four slashes again) before saving and deploying the policy again, if you don't do it the policy won't work.

    Let us know if that works.

    Thanks

    Shaheen



  • 5.  Re: Event Builder error for regex on APM Connector

    Posted Aug 21, 2017 01:45 AM

    I can't use //// in my Event Search because it's not going to bring back any events.



  • 6.  Re: Event Builder error for regex on APM Connector

    Broadcom Employee
    Posted Aug 29, 2017 10:29 AM

    Hi Madelaine,

    Your update shows you are using forward slash instead of backslash. Try using backslash and if that doesn't work open a case with CA support.

    Thanks

    Shaheen



  • 7.  Re: Event Builder error for regex on APM Connector

    Posted Aug 29, 2017 11:43 PM

    The "/" is a typo. I am using "\". Will open a case.