Scheduled PDF Delivery to file or folder not via email

Path Finder


I've got some saved searches scheduled to output CSV files using the outputcsv command which works well. From there I run a script to upload the CSV file to an SFTP server.

I'd like to do something similar with the PDF output from a Dashboard. I have Scheduled PDF Delivery via email but I'm wondering if there is a way to get the PDF output to a file rather than sent via email?


Tags (1)

Path Finder

I couldn't find any answers either, just dead ends. I got a big hammer and crammed this into the pdf generator script at /opt/splunk/etc/system/bin/ (5.0.7)
I'm sure this could be embellished to generate unique filenames, trigger some process, etc., but this was more of a proof-of-concept for me.

def _respond(self):
    # save and write out the file
        pdfsave = open('/some/path/to/myreport.pdf', 'w')

I added the three "pdfsave" lines, everything else is original script.

also, I would not recommend doing it how I did it unless you're desperate as it probably won't survive an upgrade, and may catch fire if taunted. however, it shows that splunk has the pdf file in an object just waiting to do all kinds of exciting things with. somebody who actually knew python could probably spend a couple hours and add some pretty useful features, imo.

Path Finder

Nice work! Thanks for the tip.

*NEW* Splunk Love Promo!
Snag a $25 Visa Gift Card for Giving Your Review!

It's another Splunk Love Special! For a limited time, you can review one of our select Splunk products through Gartner Peer Insights and receive a $25 Visa gift card!


Or Learn More in Our Blog >>