- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Enhanced Security Measures in Place: To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.
05-15-2024 10:28 AM
Is there a way to use XML API to query the Host-ID from Panorama logs?
I have the XML API requests to remove a user from the VPN and to add a user's device to a quarantine list working. To add a user's device to the quarantine list requires the Host-ID. I'm trying to find a way to get the Host-ID for a specific user using API and not the GUI.
05-15-2024 11:18 AM
Figured it out:
##Generate logs filtering for srcuser##
https://<FIRERWALL_NAME>/api?key=<API_KEY>&type=log&log-type=globalprotect&query=(srcuser eq 'USERNAME')
This will return a Job ID which will be used in the next command.
##Show the log you just created##
https://<FIRERWALL_NAME>/api?key=<API_KEY>&type=log&action=get&job-id=JOB_ID
This will show the logs related to the username in the first API request. The Host-ID is included in this data.
##Delete the job log you created##
https://<FIRERWALL_NAME>/api?key=<API_KEY>&type=log&action=finish&job-id=JOB_ID
05-15-2024 11:18 AM
Figured it out:
##Generate logs filtering for srcuser##
https://<FIRERWALL_NAME>/api?key=<API_KEY>&type=log&log-type=globalprotect&query=(srcuser eq 'USERNAME')
This will return a Job ID which will be used in the next command.
##Show the log you just created##
https://<FIRERWALL_NAME>/api?key=<API_KEY>&type=log&action=get&job-id=JOB_ID
This will show the logs related to the username in the first API request. The Host-ID is included in this data.
##Delete the job log you created##
https://<FIRERWALL_NAME>/api?key=<API_KEY>&type=log&action=finish&job-id=JOB_ID
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!