Is it possible to add filter on a request, i want to get pre-rulebase security rules which contains a key word, do this:
And in result i only want rules which contain "test" for example
Solved! Go to Solution.
I'm not sure you can do "like" filtering in the request itself, but you can definitely do it programmatically if you just get all the security rules.
Here's how to do this in pandevice:
from pandevice import panorama, policies pano = panorama.Panorama(host, username, password) myGroup = panorama.DeviceGroup('deviceGroupName') prb = policies.PreRulebase() # Build the object tree. pano.add(myGroup) myGroup.add(prb) # Get the answer. all_rules = policies.SecurityRule.refreshall(prb) answer = [x for x in all_rules if 'test' in x.name]
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!
The Live Community thanks you for your participation!