Dashboards & Visualizations

Check boxes using advanced module

vaishnavi07
Explorer

I need to provide check boxes with varying number of options depending on what value i select in a drop down. the drop down value is then passed to the query to get the list of options to display in check box. Am using advanced module to build my dashboard. Is there any way to do this without using sideview utils?

Tags (1)
0 Karma

ArthurGautesen
Path Finder

Depending on the specifics, you need to be certain at least one result will occur in your search. I'm using a similar dynamic checkbox list to display sourcetypes.

my search is 5 searches (four are appended to the first) just to get my "List" of checkboxes.

<input type="checkbox" searchWhenChanged="true" token="VisibleRows">
<search id="Check">
index=$Index$ $HowFarBack$ sourcetype="mySource1" | fields sourcetype | head1 | stats dc(sourcetype) as Checklist by sourcetype | eval Checklist=if(Checklist>0,"MyCheckbox1","") | table Checklist | append [search index=$Index$ $HowFarBack$ sourcetype="mySource2" | fields sourcetype | head1 | stats dc(sourcetype) as Checklist by sourcetype | eval Checklist=if(Checklist>0,"MyCheckbox2","") | table Checklist] | append [search index=$Index$ $HowFarBack$ sourcetype="mySource3" | fields sourcetype | head1 | stats dc(sourcetype) as Checklist by sourcetype | eval Checklist=if(Checklist>0,"MyCheckbox3","") | table Checklist] | append [search index=$Index$ $HowFarBack$ sourcetype="mySource4" | fields sourcetype | head1 | stats dc(sourcetype) as Checklist by sourcetype | eval Checklist=if(Checklist>0,"MyCheckbox4","") | table Checklist] | append [search index=$Index$ $HowFarBack$ sourcetype="mySource5" | fields sourcetype | head1 | stats dc(sourcetype) as Checklist by sourcetype | eval Checklist=if(Checklist>0,"MyCheckbox5","") | table Checklist]
</search>
<fieldForLabel>Checklist</fieldForLabel>
<fieldForValue>Checklist</fieldForValue>
<default>None</default>
</input>

The default for $Index$ is *
The default for $HowFarBack$ is earliest=-14d@d latest=now
The token for $Index$ is produced by a dropdown, and $HowFarBack$ is produced by a static radio list
The number of results in Checklist will produce the same list of checkbox values/labels

With this search, if there is no "mySource1" then the line will yield zero $job.resultCount$ and there will be no results for Checklist (which is preferable to a blank line in my case because one of the sourcetypes will appear in Checklist, just not necessarily all five).

Essentially the search yields dynamic results (but in this case a single field named Checklist will hold the entire list of results), which will end up as a checkbox for each result.

Hope this Helps.

0 Karma

vaishnavi07
Explorer

Please let me know if anyway is there to do this.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...