Forum Discussion

Lewis_Beard's avatar
2 years ago

Regex, Active Discovery (DS) filters, and the equals sign (=)


This post is partially FYI (for your information) and partially a question (have you experienced this).

I cloned the Network Interfaces datasource for use in a particular department's servers. I marked the original one as disabled for their folder structure, and then applied the new one only to their structure.

The reason I did this is that they wanted some custom filters on their Active Discovery, to filter out certain types of instance names.

I discovered, and this is the FYI part, that if the Attribute data coming from the equipment contains an equal sign, LogicMonitor may give unexpected results.

The question part is: has anyone else experienced this problem?

I had a filter set up with Attribute being auto.interface.description; Operation being RegexNotMatch; and Value being: to-BTS\d+-7705(-Second-Link)?,\s+IP\s+interface

This filter worked perfectly across thousands of interfaces, filtering out for example, instances with descriptions like: to-BTS0437-7705-Second-Link, IP interface, "SDP-437-to-7705-TNI:11040442" [ID:247]
However, for some reason, I found ONE interface that all my regex filters were filtering out that didnt even remotely match: 1/2/8, 10/100/Gig Ethernet SFP, "LINK-TO-CS-Spire-Backhaul=Network" [ID:38010880]

Through a bunch of pulling hair and frustration, eventually the engineer and I decided to try changing the = on the description in the equipment, to something else, and BAM the filter no longer matched (and it should not match). :)/emoticons/smile@2x.png 2x" title=":)" width="20" />

So I guess this is a FYI warning that an equals sign in the data the regex looks at, could throw off the regex match in LM. But if you take those same strings to regex101 or other online sites, you'll see that normal regex isnt thrown off by having an equals (=) in the data.

I just wanted to share, and see if anyone else had encountered thos.



No RepliesBe the first to reply