Dashboards & Visualizations
Highlighted

How to display dashboard panels dynamically?

Communicator

Hi
Anyone know how to achieve the following XML Dashboard:
I have a drop-down with 3 input values: ValueA, ValueB, ValueC.
Below I want 3 Panels to be generated based on the selected values in the drop-down.
PanelA is a column chart, PanelB is a line chart, PanelC is a Table

How can I do this so that when you select in the Dropdown:

ValueA shows PanelA
ValueB shows PanelB
ValueC shows PanelC

I would appreciate assistance with this please.
regards

Highlighted

Re: How to display dashboard panels dynamically?

SplunkTrust
SplunkTrust

Try something like this (runanywhere sample on Splunk 6.1.2 simple xml).

<form>
  <label>TestDynamicPanel</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="show1">
      <label>Dropdown1</label>
      <populatingSearch fieldForLabel="temp" fieldForValue="temp">|gentimes start=-1 | eval temp="ColumnChart" | table temp</populatingSearch>
    </input>
    <input type="dropdown" token="show2">
      <label>Dropdown2</label>
      <populatingSearch fieldForLabel="temp" fieldForValue="temp">|gentimes start=-1 | eval temp="LineChart" | table temp</populatingSearch>
    </input>
    <input type="dropdown" token="show3">
      <label>Dropdown3</label>
      <populatingSearch fieldForLabel="temp" fieldForValue="temp">|gentimes start=-1 | eval temp="Table" | table temp</populatingSearch>
    </input>
  </fieldset>
  <row>
    <panel>
      <chart depends="$show1$">
      <title>Details for $submitted:sourcetype|s$</title>
     <searchString>index=_internal | timechart count</searchString>
        <earliestTime>-15m</earliestTime>
        <latestTime>now</latestTime>
        <option name="charting.chart">column</option>
    </chart>
      <chart depends="$show2$">
      <title>Details for $submitted:sourcetype|s$</title>
     <searchString>index=_internal | timechart count</searchString>
        <earliestTime>-15m</earliestTime>
        <latestTime>now</latestTime>
        <option name="charting.chart">line</option>
    </chart>
      <table depends="$show3$">
        <searchString>index=_internal | timechart count</searchString>
        <earliestTime>-15m</earliestTime>
        <latestTime>now</latestTime>
      </table>
    </panel>
  </row>
</form>
Highlighted

Re: How to display dashboard panels dynamically?

Communicator

hi somesoni2
Thank you very much for the tip, I was reviewing the code.
There will be way to do this with one dropdownlist?

Highlighted

Re: How to display dashboard panels dynamically?

SplunkTrust
SplunkTrust

Depending upon the version that you're using, Splunk provides a feature called condition using which you can set multiple tokens from one dropdown itself. I believe the example show in below link should just work fine.

http://docs.splunk.com/Documentation/Splunk/6.3.3/Viz/PanelreferenceforSimplifiedXML#condition_.28in...

Highlighted

Re: How to display dashboard panels dynamically?

Explorer

that worked great... thanks

0 Karma
Highlighted

Re: How to display dashboard panels dynamically?

Esteemed Legend

Be sure to click Accept to close the question.

0 Karma
Highlighted

Re: How to display dashboard panels dynamically?

Communicator

hi somesoni2
I am new to splunk. I have one idea in my mind Please help me to solve this puzzle.
I have three pannels in one dashboard.
panel1
panel2
panel3

Panel one show action=allow OR blocked

Panel2 update its values once action is selected from first panel.
same like panel3 values get updates based on panel one "action" selection.

0 Karma
Highlighted

Re: How to display dashboard panels dynamically?

Communicator

Hi

I achieved the desire.

0 Karma
Highlighted

Re: How to display dashboard panels dynamically?

Esteemed Legend

Be sure to click Accept to close this question.

0 Karma
Highlighted

Re: How to display dashboard panels dynamically?

Path Finder

For more advanced behaviors you can use a little bit of JS to set tokens.

var unsubmittedTokens = mvc.Components.get('default');
unsubmittedTokens.set(<token_name>,<token_value>);

For eaxmple your first search is power by a drop down and gets displayed with the 'depends' option. With JS you can take some data from that search and automatically set a token the display a different panel.