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 Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...