Dashboards & Visualizations

dynamic change of view parameters

sansay
Contributor

Does anyone know a method to dynamically change a parameter of a view?

My current purpose is quite simple: to allow my users to change the "refresh" parameter. I find it baffling that there is just no easy way to do this. So, I added a dropdown listbox to my dashboard as follows, but it just will not affect the refresh rate. Normally the refresh rate is set by adding "refresh="time in seconds" in the definition of the view. But I want to assign values with a dropdown listbox.



refresh
Auto Refresh:


None
-1


30 seconds
30


90 seconds
90



...

Tags (3)
1 Solution

sansay
Contributor

Now that I learnt how to use Sideview I can give you the answer. In my dashboard I added a pulldown module named "refreshRate". The value of param refreshEver in module AutoRefresh is set to $refreshRate$. This works perfectly.

Here is the relevant code:

      <module name="Pulldown" layoutPanel="viewHeader">
    <param name="name">refreshRate</param>
    <param name="label">Refresh Rate</param>
    <param name="float">left</param>
    <param name="staticOptions">
        <param name="label">5 m</param>
        <param name="value">300</param>
      </list>
      <list>
        <param name="label">1 m</param>
        <param name="value">60</param>
      </list>
      <list>
        <param name="label">30 s</param>
        <param name="value">30</param>
      </list>          
    </param>

  <module name="AutoRefresh" layoutPanel="panel_row1_col1" >
    <param name="refreshEvery">$refreshRate$</param>
    <module name="Search" group="Load Average (1m)" >
        <param name="search">`LRO_load_average($selectedLine$,$selectedType$)`</param>

View solution in original post

0 Karma

sansay
Contributor

Now that I learnt how to use Sideview I can give you the answer. In my dashboard I added a pulldown module named "refreshRate". The value of param refreshEver in module AutoRefresh is set to $refreshRate$. This works perfectly.

Here is the relevant code:

      <module name="Pulldown" layoutPanel="viewHeader">
    <param name="name">refreshRate</param>
    <param name="label">Refresh Rate</param>
    <param name="float">left</param>
    <param name="staticOptions">
        <param name="label">5 m</param>
        <param name="value">300</param>
      </list>
      <list>
        <param name="label">1 m</param>
        <param name="value">60</param>
      </list>
      <list>
        <param name="label">30 s</param>
        <param name="value">30</param>
      </list>          
    </param>

  <module name="AutoRefresh" layoutPanel="panel_row1_col1" >
    <param name="refreshEvery">$refreshRate$</param>
    <module name="Search" group="Load Average (1m)" >
        <param name="search">`LRO_load_average($selectedLine$,$selectedType$)`</param>
0 Karma
Get Updates on the Splunk Community!

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

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...