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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...