- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Config Search with "Does Not Match" followed by a regex
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2019 02:43 PM - edited 04-16-2019 06:46 AM
I'm trying to identify routers and switches that don't have logging configured, but using "Does Not Match" with the value "logging" won't work as there are many configuration variants with the work logging in them like "no logging console" where the same device doesn't have a logging server configured. Normally I'd put a regex in there like 'logging [0-9]+'. Will NetMRI's config search "Does Not Match" take a regular expression of some kind?
EDIT: I've tried that and it doesn't seem to work as anticipated
Re: Config Search with "Does Not Match" followed by a regex
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2019 11:54 AM
NetMRI does not like the + or the *
Try this -
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Config Search with "Does Not Match" followed by a regex
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2019 09:10 AM
I find the documentation lacking on how each of the search operators work. What exactly do each of these do/differ?
contains
matches
does not match
regex
Does "regex" require the "/" delimiters or is that implicit or optional?
Can one use a "/regex/" for either of the other three?
Re: Config Search with "Does Not Match" followed by a regex
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2019 10:53 AM
contains
Means does this line of config exists
matches, I think the same as contains (might have to test this one)
does not match
I love this lone exmaple if every device should have "logging 10.10.10.1"
use this to seach and it will show you all the devices that does not have it configured
regex you can use any form of RegEx in here example for a basic SNMP RO seach use the following
snmp-server community Infoblox RO, snmp-server community RO RO test, snmp-server community demo RO, snmp-server community public RO
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Config Search with "Does Not Match" followed by a regex
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2019 01:56 PM
Thanks Sif,
I have *assumed* the explanations you give but have run into situations where I wasn't sure which one to use or not to use, and how the pattern matching is done. I got a strong hint from the XML policy operator definitions and I presume that what we generate via UI in the logic builder utilizes those. But it sure would be helpful to have a direct correspondence. E.G., why have "contains" and "matches"? Why isn't there a "doesn't contain"? And if those accept regex, why have a separate "regex" operator?