Hey guys,
Hope you're having a great day!
Basically, I want to show/hide multiple sets of rows and panels depending on the main drop-down selected.
Is there a <section depends=$choice1$> </section> kind of tag that can have multiple rows inside it?
Right now my only workaround is to display a link to that specific dashboard.
I want to be able to basically merge all these dashboards into one and then just select by the main drop down.
Thank you,
Best,
You can do it like this - have your input with the dropdown and then use the <change> element to set/clear the appropriate section_X tokens based on the choice made.
Here when you select a section, it will set the section_X token for the section chosen and clear the others (null() in the eval statement). Define an <eval token="section_X"> for each section you want to define.
<form>
<label>panels</label>
<fieldset submitButton="false">
<input type="dropdown" token="section" searchWhenChanged="true">
<label>Section</label>
<choice value="s1">Section 1</choice>
<choice value="s2">Section 2</choice>
<choice value="s3">Section 3</choice>
<change>
<eval token="section_1">if($value$="s1", "true", null())</eval>
<eval token="section_2">if($value$="s2", "true", null())</eval>
<eval token="section_3">if($value$="s3", "true", null())</eval>
</change>
</input>
</fieldset>
<row depends="$section_1$">
<panel>
<table>
<search>
<query>
| makeresults
| fields - _time
| eval Section="SECTION 1"
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">100</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">none</option>
<option name="percentagesRow">false</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
</table>
</panel>
</row>
<row depends="$section_2$">
<panel>
<table>
<search>
<query>
| makeresults
| fields - _time
| eval Section="SECTION 2"
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">100</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">none</option>
<option name="percentagesRow">false</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
</table>
</panel>
</row>
<row depends="$section_3$">
<panel>
<table>
<search>
<query>
| makeresults
| fields - _time
| eval Section="SECTION 3"
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">100</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">none</option>
<option name="percentagesRow">false</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
</table>
</panel>
</row>
</form>
Yup, this is what I currently have set up for multiple dashboards. (Currently main dashboard is called user lookup and takes all these info-tokens to individual dashboards via links, where each have their own dropdowns/multiselects to clear the clutter in that category.)
I wanted a drop down/multiselect envoloping all these smaller dashboards
like
<common input fields like email>
<MaindropdownCode>Main_opt1,Main_opt2,Main_opt3</MaindropdownCode>
<section depends=$Main_opt1$>
<sub inputs>
<sub dropdownCode> sub_opt1, sub_opt2, ... </>
<row depends=sub_opt1>
<panel ...></panel>
</row>
<row depends=sub_opt2>
....
</row>
...
</section>
<section depends=Main_opt2>
....
</section>
---
Anyways I'll prob try the navigation route (from another comment) and see if that works.
Thanks anyways!
Have a nice day!
Best,
The depends option can be used on the input, row, panel, search, and visualization elements to control when the element is displayed. The dashboard element cannot have a depends option.
There can be only one <dashboard> element in a dashboard so the idea of merging several dashboards into one will require refactoring of them. Consider instead using a Navigation menu to allow the user to select which dashboard to view.
By dashboard do you mean like the main tabs at top of an app?
Are tokens sharable between them?
Will probably look into having something similar to navigation tabs within the dashboard for token sharing.
Anyways I'll look into it, thanks!
Best,
The tabs at the top of the app are controlled by the Navigation menu. Tokens are not sharable between entries in the menu.
Another option is a dashboard with drilldowns to other dashboards. Tokens can be passed from the mother dashboard to the drilldown dashboards.
Yup, mother with children dashboard is exactly my current setup, but managing 7+ children(new tabs) is hard haha
Wanted quick tab switching within the dashboard.
Thanks for clearing the token sharing within navigation though!
Best,
If you want tab based switching, you can easily used linked list inputs, see this app for some CSS on how to show tabs in a nice way
https://splunkbase.splunk.com/app/5256
depends works on the presence or absence of a token, not on the value, so basically, what you are asking for can't be done that way.