Querying for Detailed HIP Report on XML API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Querying for Detailed HIP Report on XML API

L0 Member

Hi all,

 

I am wondering if anyone has found a way to query the XML API to get a HIP report back.

All I am able to retrieve with the following call is an XML formatted version of the data you can find in the HIP match log, but not the HIP report you can see in the GUI by pressing the magnifying glass next to a log. I saw another thread from 6 years ago on here with no replies and an almost identical question.

 

Current API call (sanitized):

 

https://<PAN-IP>/api/?key=<APIKEY>&type=log&log-type=hipmatch&nlogs=200&query=( user.src eq '<username>')

https://<PAN-IP>/api/?key=<APIKEY>&type=log&action=get&job-id=xxxx 

 XML I get back from the second call (sanitized and truncated):

 

<response status="success"><result>
<job>
<tenq>16:38:22</tenq>
<tdeq>16:38:22</tdeq>
<tlast>16:38:22</tlast>
<status>FIN</status>
<id>2943</id>
</job>
<log>
<logs count="200" progress="100">
<entry logid="xxxx">
<domain>1</domain>
<receive_time>2021/03/03 16:06:26</receive_time>
<serial>xxxx</serial>
<seqno>1881</seqno>
<actionflags>0x0</actionflags>
<is-logging-service>no</is-logging-service>
<type>HIPMATCH</type>
<subtype>0</subtype>
<config_ver>2049</config_ver>
<time_generated>2021/03/03 16:06:26</time_generated>
<dg_hier_level_1>0</dg_hier_level_1>
<dg_hier_level_2>0</dg_hier_level_2>
<dg_hier_level_3>0</dg_hier_level_3>
<dg_hier_level_4>0</dg_hier_level_4>
<device_name>xxxx</device_name>
<vsys_id>1</vsys_id>
<srcuser>xxxx</srcuser>
<vsys>vsys1</vsys>
<machinename>xxxx</machinename>
<src>xxxx</src>
<matchname>xxxx</matchname>
<repeatcnt>1</repeatcnt>
<os>Windows</os>
<matchtype>profile</matchtype>
<padding1>0</padding1>
<padding2>0</padding2>
<srcipv6>0.0.0.0</srcipv6>
<hostid>xxxx</hostid>
</entry>

<TRUNCATED>

 

Thank you

10 REPLIES 10

L1 Bithead

Hello, I have the same question, we need a detailed report as the one showed with the magnifying glass that can be exported for further analysis data

Does this help?

https://{{host}}/api/?key={{key}}&type=op&cmd=<show><user><hip-report><user>{{username}}</user><ip>{{user-ip}}</ip><computer>{{user-hostname}}</computer></hip-report></user></show>

 

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂

Hi Jimmy, thank you for the answer. I entered the username, user ip and computer, but the response was "can't find hip report" even when the report exists in the firewall.

Hi @KarlaLedesma, I'd recommend getting a successful output on CLI first maybe? Here is my example, try matching everything you see in the HIP logs with the CLI command like I did here, then move to the API after:

 

Screenshot 2021-06-09 at 12.25.33.png

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂

good option, but it is user per user, and we have more than 4k users. So it is a imposible task for us to get a report for all of them manually

@KarlaLedesma That's a different question than was originally asked 🙂 We've shown how to retrieve the HIP report for a user.

 

If you say you want the HIP report for all 4000 users, your workflow would be to enumerate the lists of users and machines and IP addresses (via logs or API), and then have some logic to loop through each of the users and get the HIP report for each, storing the results somewhere for whatever the purpose is of the data gathering exercise. You could use your choice of scripting or programming language to implement this workflow/logic. Hope this helps.

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂

Hi Karla,

Were you able to get it working?

Hi, No, we give up. We created some objects to match the information needed by the requestor, and that was enough information for them. 

L0 Member

Anyone got it working? I tried via the CLI and still getting the same error and no response Palo Alto Support for last 48 hours.

Hi @Ramganesh, tried to get "what" working? Which part of the discussion, what exactly are you attempting? Thanks

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂
  • 5420 Views
  • 10 replies
  • 1 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!