Dashboards & Visualizations

How to set constant values for pdf dashboard?

sabysingh
Explorer

I would like to set some constant values for use in tags in multiple panels of my dashboard (earliest time, latest time, sampling rate, etc.). This dashboard needs to run at pre-scheduled time and send a pdf report.

I set the tokens in <init> element at the beginning of the dashboard. However, per article https://docs.splunk.com/Documentation/Splunk/8.0.5/Viz/tokensPDF scheduling is disabled for dashboards and forms that include an <init> element. This is what I am experiencing; the dashboard renders ok, but PDF job fails.

Is there another option to define constant values that can be used in tags in other panel queries? I am deploying these dashboards in enterprise environment, and am looking for a solution within dashboard xml. Creating any additional configuration files is not easy to deploy or modify.

Current solution (fails for PDF generation):

<init>
<set token="sampling">20</set>
<set token="earliest">@w0-7d</set>
<set token="latest">@w0</set>
</init>

...

<query>index=xxxx | stats count by internal build </query>
<earliest>$earliest$</earliest>
<latest>$latest$</latest>
<sampleRatio>$sampling$</sampleRatio>
Labels (3)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust
Perhaps you could use macros, instead. They're easy to deploy with the same app that contains the dashboard.
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

Stay Connected: Your Guide to January Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...