Enhanced Security Measures in Place:   To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.

XML API to get all policies using same Tags

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

XML API to get all policies using same Tags

L1 Bithead

Hi All,

 

Any suggestions on how to get all the policies from paloalto with same name using XML api call.

In the Web interface in the search bar if we search using the Tag, we get all the policies containing the tag names. However, in api interfaces not able to find a xpath to fetch all the policies using tag name.

 

Thanks in Advance.

 

1 accepted solution

Accepted Solutions

L3 Networker

There's actually a ton of flexibility in XPath queries.  Try this to look for all security rules containing a tag member called "blocked":

 

/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[tag/member='blocked']

 

Here's a handy cheatsheet as well: https://devhints.io/xpath

 

Hope this helps!

View solution in original post

3 REPLIES 3

L3 Networker

There's actually a ton of flexibility in XPath queries.  Try this to look for all security rules containing a tag member called "blocked":

 

/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[tag/member='blocked']

 

Here's a handy cheatsheet as well: https://devhints.io/xpath

 

Hope this helps!

Hey @rhagen,

do you know how to achieve same with REST-API by the chance?

Thanks

Unfortunately, the REST API doesn't support inline queries at this time.

  • 1 accepted solution
  • 5080 Views
  • 3 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!