Skip to main content

I’m not sure if most people check back on the built in configs in the Forward Library, but this one is pretty slick.  Are these part of release notes or anything? I looked in the NQE documentation and didn’t find anything related, but I could be looking in the wrong spot.


@query
query(Operating_Systems: List<OS>,
Device_Name_Patterns: List<String>,
Config_Pattern: PatternBlocks<{}>) =
foreach device in network.devices
where isPresent(device.files.config)
where length(Operating_Systems) == 0 ||
device.platform.os in Operating_Systems
where length(Device_Name_Patterns) == 0 ||
max(foreach pattern in Device_Name_Patterns
select matches(device.name, pattern))
foreach match in blockMatches(device.files.config, Config_Pattern)
select {
Device: device.name,
OS: device.platform.os,
"OS Version": device.platform.osVersion,
Model: device.platform.model,
Match: match.blocks,
Tags: device.tagNames
};

Regardless, these queries need more PR for the users. Thanks to whoever developed it under: To find: goto: Forward Library→ Devices → Config Diff or Config Search

Click Parameters and add the variables you are looking for.

 

Hi @cariddir,

I’m glad you found this useful. I’m biased, but I think it is a really cool feature and query, too! 😁

It is a bit buried, but the general capability (but not necessarily this specific query) is mentioned in the docs and release docs:


Ahhhh, in the release docs. I’m the guy who tries putting things together out of the box, THEN read the documentation! ;-)

(doesn’t work well for IKEA).

Perfect, and yes, very cool feature!


Reply