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!

AppDynamics Summer Webinars

This summer, our mighty AppDynamics team is cooking up some delicious content on YouTube Live to satiate your ...

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...