Service Operations Insight

Tech Tip:  Using the Parse function in Event Policies

  • 1.  Tech Tip:  Using the Parse function in Event Policies

    Posted Nov 25, 2015 10:47 AM

    When using the Parse function in Event Policies, make sure you specify the parsing pattern as exact as possible, especially using the left anchor ^.

     

     

    Also the usage of ? for "shortest possible string" is a good practice.

     

    Without the left anchor, an additional .* is added at the beginning of the pattern when the policy is generated.

    This can destroy your pattern or create unexpected results.

     

    Example, to look for the first part of a Full Qualified domain Name:

    string:   abc-server.ca.com

    Specified pattern: (.*)\..*

    Generated pattern: .*(.*)\..*.*

    Expected result:   abc-server

    Result with specified pattern: abc-server.ca

    Result with generated pattern:  <empty>

     

    Updated pattern to receive the expected result:

    ^(.*?)\..*

     

    @MichaelBoehm

     

    Message was edited by: Melissa Potvin