Dashboards & Visualizations

Am I able to use tokens for a report selection drop-down on a Simple XML dashboard?

bandit
Motivator

I wanted to use tokens to allow the dropdown selection of scheduled reports within a dashboard. Is this possible?

Example simple xml:

<form>
  <label>Dashboard Test</label>
  <description></description>
  <fieldset submitButton="false">
    <input type="dropdown" token="report" searchWhenChanged="true">
      <label>Report Selector</label>
      <choice value="timechart_hosta">Timechart Host A</choice>
      <choice value="timechart_hostb">Timechart Host B</choice>
    </input>
  </fieldset>
  <row>
    <panel>
      <chart>
        <title>$report$</title>
        <search ref="$report$"></search>
        <option name="charting.axisY2.enabled">undefined</option>
      </chart>
    </panel>
  </row>
</form>
0 Karma
1 Solution

bmacias84
Champion

Yes, I would consider using the savedsearch command. It would like something like whats below.

<form>
   <label>Dashboard Test</label>
   <description></description>
   <fieldset submitButton="false">
     <input type="dropdown" token="report" searchWhenChanged="true">
       <label>Report Selector</label>
       <choice value="timechart_hosta">Timechart Host A</choice>
       <choice value="timechart_hostb">Timechart Host B</choice>
     </input>
   </fieldset>
   <row>
     <panel>
       <chart>
         <title>$report$</title>
         <searchString>savedsearch $report$</searchStrin
         <option name="charting.axisY2.enabled">undefined</option>
       </chart>
     </panel>
   </row>
 </form>

View solution in original post

bmacias84
Champion

Yes, I would consider using the savedsearch command. It would like something like whats below.

<form>
   <label>Dashboard Test</label>
   <description></description>
   <fieldset submitButton="false">
     <input type="dropdown" token="report" searchWhenChanged="true">
       <label>Report Selector</label>
       <choice value="timechart_hosta">Timechart Host A</choice>
       <choice value="timechart_hostb">Timechart Host B</choice>
     </input>
   </fieldset>
   <row>
     <panel>
       <chart>
         <title>$report$</title>
         <searchString>savedsearch $report$</searchStrin
         <option name="charting.axisY2.enabled">undefined</option>
       </chart>
     </panel>
   </row>
 </form>

alvaro_garcia
Explorer

Hello Splunkers,
I have a similar problem, in my case I need to use a report, becouse my users dont have acces to the index, is there any way to use tokens or reports with tokens o dropdown menus?

Is there any way to replace the

thanks in advance

0 Karma

bandit
Motivator

Thanks. This is what I got working where it prepends the appropriate host name to call the reports for that host.

<form refresh="600">
  <label>DC Details Clone</label>
  <description></description>
  <fieldset submitButton="false">
    <input type="dropdown" token="report" searchWhenChanged="true">
      <label>Report Selector</label>
      <choice value="hosta">Host A</choice>
      <choice value="hostb">Host B</choice>
      <choice value="hostc">Host C</choice>
    </input>
  </fieldset>
  <row>
    <panel>
      <chart>
        <title>CPU vs. 4 Week Average</title>
        <searchString>savedsearch "$report$ CPU vs. 4 Week Average"</searchString>
        <option name="charting.axisY2.enabled">undefined</option>
      </chart>
    </panel>
  </row>
    <row>

    <panel>

      <chart>

        <title>CPU Today vs. Yesterday</title>

        <searchString>savedsearch "$report$ CPU Today vs. Yesterday"</searchString>

        <option name="charting.axisY2.enabled">undefined</option>

      </chart>

    </panel>

  </row>
</form>
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...