Skip to main content

i am using below query to get the F5 Partition details.

========================

 

foreach device in network.devices

where device.platform.vendor == Vendor.F5

let outputs = device.outputs

foreach c in outputs.commands

where c.commandType == CommandType.PARTITION_CONFIG

select {

  Device: device.name,

  Location: device.locationName,

  "Partition Name": c.response

}

=====================================

 

 

but the output is not looks good , i am also getting the Partition description in Output , i just need only Partition name only , Please help 

 

 

@Rohit_809 Kumar I don’t have a specific example of the partition output but here is an example how you can achieve your goals.
 

test =
"""

auth partition Common {
description "Default partition"
full-path /Common
inherited-devicegroup true
inherited-traffic-group true
default-route-domain 0
}

auth partition MyPartition {
description "Custom partition for specific applications"
full-path /MyPartition
inherited-devicegroup false
inherited-traffic-group false
default-route-domain 1
}

""";

pattern =
```
auth partition {part_name:string}
description {desc:(string*)}
full-path {fp:string}
```;



// foreach device in network.devices
// where device.platform.vendor == Vendor.F5
// let outputs = device.outputs
// foreach c in outputs.commands
// where c.commandType == CommandType.PARTITION_CONFIG

foreach x in 0]
let config = parseConfigBlocks(OS.UNKNOWN, test)
let matches = blockMatches(config, pattern)
foreach match in matches
let data = match.data
select {
partition: data.part_name, description: data.desc, "full-path": data.fp
}

See 

For an example how to apply this.


Reply