Dashboards & Visualizations

How to set constant values for pdf dashboard?

Engager

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 (4)
Tags (1)
0 Karma

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, an upvote would be appreciated.
0 Karma