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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...