Custom report via Panorama using XML-API

Announcements

ATTENTION Customers, All Partners and Employees: The Customer Support Portal (CSP) will be undergoing maintenance and unavailable on Saturday, November 7, 2020, from 11 am to 11 pm PST. Please read our blog for more information.

Reply
Highlighted
Not applicable

Custom report via Panorama using XML-API

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


Accepted Solutions
Highlighted
L3 Networker

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


All Replies
Highlighted
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"

Highlighted
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>

Highlighted
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=******

Highlighted
Not applicable

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>

Highlighted
L3 Networker

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 Live Community as a whole!

The Live Community thanks you for your participation!