Reporting

## Can a scheduled dashboard pdf delivery be sent to a share instead of an email?

Champion

Hi all,

We have a few daily reports created via scheduled pdf delivery of dashboards. They are emailed to the user as designed. But the user does not want to get emails. Instead, she'd prefer the pdf's be delivered to a share (that's how their previous product worked). As of now, she has to manually copy the reports to the share every day.

Is that possible in Splunk, and I'm missing the option/config somewhere? Or is it just email at the moment? If not, does anyone know if there is an enhancement request for that functionality I can jump on?

Worst case for now, I'll try to script it if needed.

Thanks!

Tags (2)
1 Solution
Influencer

I don't believe you can do this in the GUI, but with a simple curl command you can schedule it via cron:

curl -sku youruser:yourpass 'https://localhost:8089/services/pdfgen/render?input-dashboard=your_view_name&namespace=your_app_context&paper-size=a4-landscape' >> your_view.pdf

Champion

For my own reference later or if anyone else needs something similar, here is the basic powershell script I'm using to implement the rest call that twinspop provided.

Add-Type @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class ServerCertificateValidationCallback
{
public static void Ignore()
{
ServicePointManager.ServerCertificateValidationCallback +=
delegate
(
Object obj,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors errors
)
{
return true;
};
}
}
"@

[ServerCertificateValidationCallback]::Ignore();
Invoke-WebRequest -Uri "https://mysplunkserver:8089/services/pdfgen/render?input-dashboard=my_cool_dashboard&namespace=my_sweet_app&paper-size=a4-landscape" -Method Get -Credential me -TimeoutSec 900 -OutFile C:\Users\me\Desktop\it_worked.pdf


Everything except the Invoke-WebRequest command was borrowed from this post, and is intended to ignore ssl errors.

Influencer

Really handy to have. Thanks!

Influencer

I don't believe you can do this in the GUI, but with a simple curl command you can schedule it via cron:

curl -sku youruser:yourpass 'https://localhost:8089/services/pdfgen/render?input-dashboard=your_view_name&namespace=your_app_context&paper-size=a4-landscape' >> your_view.pdf

Champion

hmm...I'll give this a shot. Thanks!

Champion

Alright, this seems to be working! I verified pretty quickly that running the curl from the splunk server itself (linux) worked. I was able to copy it over to the windows world and it opened as expected in adobe.

I then wanted to be sure I could initiate from the windows world, because that's probably where i'll need to set the scheduled task. So after a bunch of ssl issues and many google searches, I found the right way to ignore the cert checks for hitting our server's management port (there is no -insecure switch for powershell's curl equivalent). And I was able to hit the right endpoint and output the pdf to a file on my desktop.

I have a few more steps to work out, but they are more account/powershell stuff. I'm pasting my powershell code in a separate answer so it might be easier to find if someone needs it.

SplunkTrust

Wouldn't this require OP to encode the PDF file first into a base64 string to send it as a web service call?

SplunkTrust

To my knowledge, this can't be done unless you script it. We've done something similar using Automic Automation Engine and Splunk which will poll an inbox and FTP the scripts to their location.

Champion

Thanks for the reply. I thought that might be the case, but was hoping I was wrong

Get Updates on the Splunk Community!

#### Maximize the Value from Microsoft Defender with Splunk

<P style=" text-align: center; "><span class="lia-inline-image-display-wrapper lia-image-align-center" ...

#### This Week's Community Digest - Splunk Community Happenings [6.27.22]

<FONT size="5"><FONT size="5" color="#FF00FF">Get the latest news and updates from the Splunk Community ...

#### Reminder! Splunk Love Promo: \$25 Visa Gift Card for Your Honest SOAR Review With ...

We recently launched our first <A ...