Custom report via Panorama using XML-API

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom report via Panorama using XML-API

Not applicable

Hi,

I am trying to create a custom report via Panorama and then retrieving the report data using the XML APIs.

I am using the following XML-API URL to create a custom report.

https://<Panoram IP>/api/?type=config&action=set&key=<KEY>&xpath=/config/shared/reports/entry[@name='report-1']&element=<type><panorama-trsum><aggregate-by><member>from</member><member>to</member></aggregate-by><values><member>sessions</member><member>bytes</member></values></panorama-trsum></type><period>last-15-minutes</period><topn>10</topn><topm>10</topm>

I am able to configure the custom report on Panorama.

However, I am not able to retrieve the report data using the XML-API.

I am using the following XML-API URL:

https://<Panoram IP>/api/?key=<KEY>&type=report&reporttype=custom&reportname=report-1

Instead of getting the report data, I am getting the following response:

<response status="success">

<result>

<msg>

<line>Report job enqueued with jobid 10</line>

</msg>

<job>10</job>

</result>

</response>

Can anyone please let me know how to retrieve the report data using the XML-API from the Panorama.

Regards,

Charanjeet

1 ACCEPTED SOLUTION

Accepted Solutions

This is correct, once you get the the job id you need to read the results of this job using the below string: (replace the xx with your variables)

https://.x.x.x.x/api/?type=log&action=get&job-id=xx&key=xxxxxxx

View solution in original post

5 REPLIES 5

L5 Sessionator

Have you looked at this document https://live.paloaltonetworks.com/docs/DOC-4126 page 11:

"..retrieve a dynamic report data using reporttype=dynamic, reportname=custom-dynamic-report, and cmd=report-definition where report definition is the XML definition retrieved from the xml api get"

L3 Networker

Once you kick off the report using the API, make note of the Job id...you then need to read the report data using the job ID..see below for an example

https://<panIP>/api/?type=log&action=get&job-id=<job id>&key=<your account key>

L3 Networker

If you need to create a key for an existing account on the PAN see below for an example assuming you use the account named "admin"

https://x.x.x.x/api/?type=keygen&user=admin&password=******

Hi zarina,

I followed the XML API document but got the same response:

<response status="success">

<result>

<msg>

<line>Report job enqueued with jobid 15</line>

</msg>

<job>15</job>

</result>

</response>

This is correct, once you get the the job id you need to read the results of this job using the below string: (replace the xx with your variables)

https://.x.x.x.x/api/?type=log&action=get&job-id=xx&key=xxxxxxx

View solution in original post

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!