- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
08-05-2013 01:40 AM
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
08-06-2013 10:23 AM
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
08-05-2013 03:04 PM
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"
08-05-2013 03:11 PM
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>
08-05-2013 03:23 PM
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"
08-05-2013 11:57 PM
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>
08-06-2013 10:23 AM
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
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!