- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
08-21-2018 03:50 PM
Trying to get some info from the XML API in the form of panxapi.
I'm not sure this even works based on previous forum post by others but this is the closest I could find and it's based on the description having the term Donkey.
xpath="/config/devices/entry[@name='localhost.localdomain']/device-group/pre-rulebase/security/rules/entry[description[contains(text(), 'Donkey')]]"
panxapi.py -sxr $xpath Extra options after xpath: ["'Donkey')]]"] show: error: "No such node"
show: error: "No such node"
My goal is to pull all Security Policies with a particular tag, xpath seems a bit limited, am I heading down the right path?
08-21-2018 04:31 PM
Hi @cgrosskopf
I have also experienced similar problems where the implemented xpath in PAN-OS has some limitations (or I was too stupid and the problem was a type error or something special that needs to be considered here in order to make the query work). Anyway, what I did in most cases was I did the query in a more general way and used the xpath in the programming/scripting language you need, because there you (probably) won't have these limitations and you can use whatever xpath function you need to filter the output in a mlre specific way.
08-22-2018 07:45 AM
Good point. I guess I just thought extracting the needed information would be best but you're right, I can use python to pull the pertinent information.
Thanks!
08-23-2018 05:40 AM
There appears to be a syntax error in your request, as you have a hanging ")" after Donkey.
I do not know exactly what is wrong, but my guess is it is related to that one or the prior one, maybe it should be text('Donkey') instead of text(), 'Donkey'
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 LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!