Is there an XML API query to find the Host-ID from Panorama logs

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

Is there an XML API query to find the Host-ID from Panorama logs

L1 Bithead

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.

1 accepted solution

Accepted Solutions

L1 Bithead

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

View solution in original post

1 REPLY 1

L1 Bithead

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

  • 1 accepted solution
  • 608 Views
  • 1 replies
  • 0 Likes
  • 47 Subscriptions
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!