Standard query patterns often miss specialized device data like QoS stats, feature-specific configurations, or vendor-specific health metrics. Custom commands allow you to fill those gaps—delivering targeted insights without sifting through raw CLI logs or spreadsheets.
ap_config =```
{name:string} {group:string} {type:string} {ip:ipv4Address} {status: ("Up" string | "Down")} {flag:string} {ipSwitch:ipv4Address} {ipStandby:ipv4Address}
```;
status(stat) =
if isPresent(stat) then "Up" else "Down"
;
foreach device in network.devices
foreach command in device.outputs.commands
where command.commandText == "show ap database"
let parsed_response = parseConfigBlocks(OS.ARUBA_WIFI, command.response)
let my_data = blockMatches(parsed_response, ap_config)
foreach ap in my_data
select {
name: ap.data.name,
group: ap.data.group,
type: ap.data.type,
ip: ap.data.ip,
status: status(ap.data.status.left),
uptime: ap.data.status.left,
flags: ap.data.flag,
switch_ip: ap.data.ipSwitch,
standby_ip: ap.data.ipStandby,
controller: device.name
}
For a complete walkthrough with device-specific examples, parsing tips, and CI/CD integration ideas, check out the original post:
A Basic Guide to Extracting Data from Custom Commands