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.