Dashboards & Visualizations

Why does my dashboard panel not automatically refresh upon selecting a value from a drop-down menu?

IRHM73
Motivator

Hi, I wonder whether someone may be able to help me please.

I'm trying to implement functionality on one of my dashboard panels which allows the user to select the 'refresh'. I ran a search and found a post here and so implemented the code as below:

 <panel>
          <input type="dropdown" token="refresh_interval" searchWhenChanged="true">
               <label>Panel Refresh Override</label>
               <choice value="60">1 Minute</choice>
               <choice value="180">3 Minutes</choice>
               <choice value="300">5 Minutes</choice>
               <default>300</default>
             </input>
          <table>
            <title>Partially Completed Submissions With Expiry Date of......</title>
            <search>
              <query>index=main auditSource=for-frontend auditType=FormSaved | rename generatedAt As "submissiondate" | eval submissiondate=strptime(submissiondate, "%Y-%m-%dT%H:%M:%S")|convert timeformat="%d/%b/%Y" ctime(submissiondate) | eval testtime=relative_time(now(), "-1d@d" )  | eval c_time=strftime(testtime,"%d/%b/%Y") | where c_time=submissiondate | head 1 | search NOT[search index=main auditSource=for-frontend auditType=FormSubmission | table detail.referenceNumber] | rename detail.referenceNumber As "refno" | rename detail.name As "fullname" | rename detail.90DayExpirationDate As "expirydate" | eval expirydate=strptime(expirydate, "%Y-%m-%dT%H:%M:%S")|convert timeformat="%d/%b/%Y" ctime(expirydate) | eval Full_Details= "Ref No: ".refno.", Fullname: ".fullname.", Date of submission: ".submissiondate.", Expiry Date: ".expirydate | makemv delim=", " Full_Details | table Full_Details</query>
              <earliest>0</earliest>
              <latest></latest>
            </search>
            <option name="wrap">true</option>
            <option name="rowNumbers">false</option>
            <option name="drilldown">cell</option>
            <option name="dataOverlayMode">none</option>
            <option name="count">10</option>
            <option name="refresh.auto.interval">$refresh_interval$</option>
          </table>
        </panel>

The problem is, no matter the selection made on the drop-down menu, the panel does not refresh.

I just wonder whether someone could look at this please and let me know where I've gone wrong.

Many thanks and kind regards

Chris

1 Solution

s2_splunk
Splunk Employee
Splunk Employee

I don't think you are doing anything syntactically wrong, except that tokens don't appear to be supported in options XML elements, as it appears.
While our documentation doesn't explicitly state that, it also doesn't have any examples for that usage.
You will have noticed that your panel also didn't refresh when you select a value. Try adding | eval foo=$refresh_interval$ to your search string for that panel and notice how the panel reloads every time you pick another value. But your refresh interval will still use the default value.

View solution in original post

woodcock
Esteemed Legend

If you need your users to be able to manually refresh panels, then just train them how to use the built-in capability for this. In the lower-left corner of each pane should be 4 icons: Magnifying Glass, Down Arrow, Italic "i", and Circular Arrow. Whenever the last one is clicked, the panel is refreshed.

IRHM73
Motivator

Hi @woodcock, many thanks for your help and for the advice.

Kind Regards

Chris

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

You meant "the last one"... 😉

0 Karma

woodcock
Esteemed Legend

Yes, and now fixed.

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

I don't think you are doing anything syntactically wrong, except that tokens don't appear to be supported in options XML elements, as it appears.
While our documentation doesn't explicitly state that, it also doesn't have any examples for that usage.
You will have noticed that your panel also didn't refresh when you select a value. Try adding | eval foo=$refresh_interval$ to your search string for that panel and notice how the panel reloads every time you pick another value. But your refresh interval will still use the default value.

IRHM73
Motivator

Hi @ssievert, many thanks for your help and guidance.

Kind Regards

Chris

0 Karma

mpc7zh
Engager

Is there any workaround to get the panels to refresh based off a token value?

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.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 ...