Dashboards & Visualizations

how to refresh a panel values based on input token

krishnarajb2304
Explorer

Right now refreshing the panel using <option name="refresh.auto.interval">120</option>

would like to keep the drop down (token=refresh) 30,60,120,never. Tried to populate with <option name="refresh.auto.interval">$refresh$</option>

Anyway thoughts will be helpful?

0 Karma
1 Solution

niketn
Legend

@krishnarajb2304, refresh.auto.interval has been deprecated. Post Splunk Enterprise 6.5 onwards, you should be using <refresh> option within search to refresh the panel/s which is/are dependent on the same. Parameter to refresh option can be passed as token similar to the way you intend to via Simple XML. Following is an example (PS: You should be on 6.5 or later for using both refresh and init option as used in the following example).

I have set Interval as 2 minute (2m) in the init section using set command

<dashboard>
    <label>Auto Refresh Search and Panel/s</label>
      <init>
        <set token="Interval">2m</set>
      </init>
      <row>
        <panel>
          <single>
            <search>
              <query>index=_internal sourcetype=splunkd log_level!="INFO"
    | stats count</query>
              <earliest>-7d@d</earliest>
              <latest>now</latest>
              <sampleRatio>1</sampleRatio>
              <refresh>$Interval$</refresh>
            </search>
            <option name="drilldown">none</option>
          </single>
        </panel>
      </row>
</dashboard>

<refresh>$Interval$</refresh> sets the Search to refresh every 2 minutes through the token set in the init section.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@krishnarajb2304, refresh.auto.interval has been deprecated. Post Splunk Enterprise 6.5 onwards, you should be using <refresh> option within search to refresh the panel/s which is/are dependent on the same. Parameter to refresh option can be passed as token similar to the way you intend to via Simple XML. Following is an example (PS: You should be on 6.5 or later for using both refresh and init option as used in the following example).

I have set Interval as 2 minute (2m) in the init section using set command

<dashboard>
    <label>Auto Refresh Search and Panel/s</label>
      <init>
        <set token="Interval">2m</set>
      </init>
      <row>
        <panel>
          <single>
            <search>
              <query>index=_internal sourcetype=splunkd log_level!="INFO"
    | stats count</query>
              <earliest>-7d@d</earliest>
              <latest>now</latest>
              <sampleRatio>1</sampleRatio>
              <refresh>$Interval$</refresh>
            </search>
            <option name="drilldown">none</option>
          </single>
        </panel>
      </row>
</dashboard>

<refresh>$Interval$</refresh> sets the Search to refresh every 2 minutes through the token set in the init section.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...