DX Infrastructure Management

Expand all | Collapse all

Regex in SNMPCOLLECTOR Probe template

  • 1.  Regex in SNMPCOLLECTOR Probe template

    Posted 08-31-2016 04:38 AM

    Screen Shot

     

    Hi,

     

    I am trying to get Regex to work in my SNMPCOLLECTOR Probe's template, I am trying to create a rule using Regex to filter any Interface Descriptions that contains the word "channel" or "core".

     

    Some examples are:

    "WAN channel101"

    "WAN channel102"

    "CDP core3 switch"

    "CDP core5 switch"

    etc

     

    Would this be the correct Regex syntax?

    /channel.* | core.*/



  • 2.  Re: Regex in SNMPCOLLECTOR Probe template

    Posted 08-31-2016 09:18 AM

    I believe that the correct regex expression would be:

     

    /.*channel.*|.*core.*/



  • 3.  Re: Regex in SNMPCOLLECTOR Probe template

    Posted 08-31-2016 02:53 PM

    I tried /.*channel.*|.*core.*/ and also /.*channel.*/ in the SNMPCOLLECTOR template (the screen shot in my first post)

     

    Both didn't work 

     

    Could it be a system bug?



  • 4.  Re: Regex in SNMPCOLLECTOR Probe template

    Posted 09-01-2016 11:18 AM

    Hi Kathryn (& anyone else who have read this),

     

    My bad...Your suggestion does work in the SNMPCOLLECTOR template, just need to remove the "/" sign.

     

    Also to note, Regex is case sensitive too apparently...that was why initially I thought it wasn't working.

     

    Thank you 



  • 5.  Re: Regex in SNMPCOLLECTOR Probe template

    Posted 09-05-2016 07:15 AM

    Hi Kathryn,

     

    Do you know how to do a negate Regex?

     

    I found this:  (?!.*xyz.*)

    But not sure why it doesn't work

     

    Ideally, this Regex should match every text, except for text that contains "xyz".



  • 6.  Re: Regex in SNMPCOLLECTOR Probe template

    Posted 09-14-2016 11:16 AM

    Try the following regular expression to exclude all patterns that contain xyz:

     

    ^((?!xyz).)*$



  • 7.  Re: Regex in SNMPCOLLECTOR Probe template

    Posted 08-28-2018 11:58 PM