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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...