Dashboards & Visualizations

Enhancement Request: Add "button" which allows us to change other tokens when user clicks on it

spammenot66
Contributor

Currently there's no way to reset or revert a token (or in some cases multiple tokens) to previous value or maybe a default value. Let say you have a dashboard
filter1=*
filter2=*
filter3=*

as users engage in your dashboard, filter1, filter2, and filter3 may change to different values that are not . Normally people associate a "reset" form with a button such as a "reset button". It would be fantastic SPLUNK adds button where we can change the onclick listener to set the values of other token when needed.
In this example, if we added a "reset" button, when users click on it, we could set
filter1=

filter2=*
filter3=*

The other options i've seen
1) requires providing a link to same dashboard with various tokens predefined. IMO this is a silly method because it requires your user to reload the whole dashboard JUST to reset it. In most cases, its quicker for them to just hit the refresh button but that kinda defeats the purpose of clearing out a token
2) using an input field to do what is mentioned here. Its a working solution but rather ugly UI. In this case, we're expecting our user to type in something to clear out a filter instead of the universal "click on reset button".

mstadler_splunk
Splunk Employee
Splunk Employee

My customer did come up with this little generic code using the css classes from Splunk itself. Just put it inside the fieldset tag and change the href to the dashboard filename:

    <html>
      <style>
          div.fieldset.dashboard-form-globalfieldset div.dashboard-element.html.dashboard-element-html {
            display: inline-block;
          }
      </style>
      <a href="{dashboard_filename}" class="btn btn-primary">Reset</a>
    </html>
0 Karma

spammenot66
Contributor

In case anyone else had similar issues, hitting refresh doesn't clear all forms to "reset the dashboard".

To reset, i found it easier to put a link on your dashboard pointing to same dashboard. This will force it to reload everything with default setting. Don't forget to replace {dashboard_filename} with the your actual dashboard file name/URL.

<html>
        <a href="{dashboard_filename}" class="reset_btn">Reset Dashboard</a>
        <style>

           .reset_btn{

               border-radius: 5px;
               font-size: 12px; 

               font-family:"Roboto","Droid","Helvetica Neue",Helvetica,Arial,sans-serif;
               text-decoration: none;
               background-color: #EEEEEE;
               color: #333333;
               padding: 6px 8px 6px 8px;
               border-top: 1px solid #CCCCCC;
               border-right: 1px solid #333333;
               border-bottom: 1px solid #333333;
               border-left: 1px solid #CCCCCC;
             }

       </style>

      </html>
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...