Dashboards & Visualizations

How to export a dashboard as PDF on demand from Splunk REST API / Java SDK ?

kayzid
Engager

Hi,

I am new to splunk and I am trying to work with the SDK. Is there a way to export your dashboard as a PDF on demand using either Java SDK/Rest API?

thanks

newsureman
Engager

Maybe it's time to draft some doc on this feature, when I tried to use the pdfgen/render service, I got the following error message:

404 Not Found

Return to Splunk home page
Page not found!

Any help is greatly appreciated!

Iriseng94
Explorer

Hi , I got the same error too. How do u resolve this ?

0 Karma

twinspop
Influencer

Wow, this is old. Just for grins, i think this answers the question:

curl -sku admin 'https://localhost/services/pdfgen/render?input-dashboard=your_view&namespace=your_app&paper-size=a4-landscape' > your_report.pdf

damode
Motivator

This command works for dashboards that dont require any user input.

How can we use the above to command to export a dashboard that requires user inputs ?

I tried the curl command to export the Splunk for PaloAlto Networks app's main dashboard and it worked. However, when I tried the same command with additional parameters for Cisco app's dashboard, it just generated an unreadable1kb pdf file.

Example below,
curl -u admin:{password} -k "https://localhost:8089/services/pdfgen/render?input-dashboard=CiscoNetworksOverview&namespace=cisco_..." >> C:\Users\admin\Downloads\test.pdf

Any workaround for this please?

0 Karma

anwarmian
Communicator

You can write a python script to achieve your requirement. I was successful in doing so. Please check the following link.

https://answers.splunk.com/answers/366832/generate-pdf-from-view-in-rest-api.html

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...