- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
03-23-2020 10:31 PM - edited 03-23-2020 10:38 PM
Trying the API in browser. Clicking either submit or the URL give me error "show rule hit count op-command failed'
Tried on 5250 multi-vsys and 220, both on 8.1.8-h5
https://PA/api/?REST_API_TOKEN=111111111&type=op&cmd=%3Cshow%3E%3Crule-hit-count%3E%3Cvsys%3E%3Cvsys-name%3E%3C%2Fvsys-name%3E%3C%2Fvsys%3E%3C%2Frule-hit-count%3E%3C%2Fshow%3E
I managed to run the code and used on my firewall and was successful. But direct browsing fails.
https://panos.pan.dev/docs/apis/panos_tutorials_rule_hit_count
This uses
<show><rule-hit-count><vsys><vsys-name><entry name='vsys1'><rule-base><entry name='security'><rules><all></all></rules></entry></rule-base></entry></vsys-name></vsys></rule-hit-count></show>"
03-25-2020 04:40 PM
The reason it's failing is because the GUI API browser is already at the following XML location (per your first screenshot): show > rule-hit-count > vsys > vsys-name
The API browser kinda fails when you need to give multiple params at a specific depth... I don't know if it'd work, but you could try going back to the vsys
location, then pasting the entire vsys-name
block from opening to close and see if that works..?
03-25-2020 09:33 PM
@gfreeman I browsed API till vsys-name and there is nothing below it. Also i tried going up it still failed.
Then i copied the text above and it showed results although not human readable
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!