03-04-2021 11:51 AM
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
06-01-2021 08:28 AM
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
06-02-2021 02:18 AM
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>
06-02-2021 03:36 PM
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.
06-09-2021 04:30 AM
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:
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!