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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...