Trigger a PDF via the command line



I would like to create a script that would trigger a pdf creation of a dashboard. I understand how to create a pdf and send via a saved search, but I would like to use a script to perform the same function.

I am having a little trouble understanding how the pdf renderer works and cannot find any documentation that would describe how to do this...Does anyone have any ideas?

Regards Vince

New Member

I have exactly same requirement where create a dashboard and schedule PDF delivery for that.
I am new to splunk REST API concepts. Can you please explain the script mentioned here
what is PDF Trigger here? Is it an alert with name whatever_alert?
what is ScheduledView_mypdf, it also looks like an alert ?

Where is whatever_alert used in the script?
curl -k -u admin:password https://localhost:8089/servicesNS/admin/search/saved/searches/_ScheduledView__mypdf/dispatch -d trigger_actions=1
How does splunk server know that whatever_alert needs to be called for this ScheduledView_mypdf?

I need to do all these using Splunk Java SDK. Any step by step instruction on how to do this will be appreciated. Thanks in advance!

0 Karma


This works!


action.script = 1
action.script.filename =
cron_schedule = */10 * * * *
dispatch.earliest_time = -2m@m
dispatch.latest_time = now
displayview = flashtimeline
enableSched = 1
counttype = number of events
relation = greater than
quantity = 0
search = index=ops | head 2


[_ScheduledView__mypdf] = 1 = 60m = portrait = letter = mypdf = 1 = = 10
cron_schedule = */5 * * * *
description = scheduled search for view name=mypdf
dispatch.earliest_time = 1
dispatch.latest_time = 2
enableSched = 0
is_visible = 0
search = | noop


curl -k -u admin:password https://localhost:8089/servicesNS/admin/search/saved/searches/_ScheduledView__mypdf/dispatch -d trigger_actions=1


If that user expires because they leave the company, then what? Is there a caveat to using admin?

0 Karma


It might be a good idea to use a different user than admin. If you do the url changes to:
https://localhost:8089/servicesNS/my_user/search/saved/searches/_ScheduledView__mypdf/dispatch -d trigger_actions=1

0 Karma

New Member

Very nice - this works great.

0 Karma


one more try to see if anyone has any ideas?

0 Karma


Sorry, just to clarify this a bit further, the view I have set up is complex and has a lot of graphs, etc. So it is not something that I can run as a search and then use sendemail. I am wanting to generate the pdf from the html page and then forward this pdf onto an email address, similar to using a scheduled search but I need to be able to trigger it from a script

0 Karma
Get Updates on the Splunk Community!

The Splunk Success Framework: Your Guide to Successful Splunk Implementations

Splunk Lantern is a customer success center that provides advice from Splunk experts on valuable data ...

Splunk Training for All: Meet Aspiring Cybersecurity Analyst, Marc Alicea

Splunk Education believes in the value of training and certification in today’s rapidly-changing data-driven ...

Investigate Security and Threat Detection with VirusTotal and Splunk Integration

As security threats and their complexities surge, security analysts deal with increased challenges and ...