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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...