Splunk Enterprise

How to check all the checkboxes option based on the result obtained from the query?

Ashwini008
Builder

Hi,

My requirement is to check all the checkboxes based on the results obtained from the query.

Example: When my query runs it gives the below results of sourcetype. They are displayed as checkbox options. Only first sourcetype "HR" is checked and others are unchecked. I want my query all results to be checked which i am failing to do so. 

sourcetype
HR
LP
MN

I am using the below code

<input type="checkbox" id="check1" token="environment" searchWhenChanged="true">
<label>Environments</label>
<search>
<query>index = main sourcetype = landscape earliest=-48h |dedup sourcetype
| table sourcetype</query>
</search>
<change>
<condition value="HR">
<set token="HR">HR</set>
</condition>
<condition>
<unset token="HR"></unset>
</condition>
</change>
<default>*</default>
<initialValue>*</initialValue>
<delimiter> </delimiter>
<fieldForLabel>sourcetype</fieldForLabel>
<fieldForValue>sourcetype</fieldForValue>
</input>

any suggestions on how i can do this ?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Checkboxes are in the <input> element because they are inputs to a query.  They are not outputs.

You can set tokens based on the results of a query, but that will not affect any inputs associated with those tokens.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...