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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...