XML API to get all policies using same Tags

Announcements

ATTENTION Customers, All Partners and Employees: The Customer Support Portal (CSP) will be undergoing maintenance and unavailable on Saturday, November 7, 2020, from 11 am to 11 pm PST. Please read our blog for more information.

Reply
Highlighted
L0 Member

XML API to get all policies using same Tags

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.

 

Tags (3)
Highlighted
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!

Highlighted
L0 Member

Hey @rhagen,

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

Thanks

Highlighted
L3 Networker

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

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 Live Community as a whole!

The Live Community thanks you for your participation!