All Apps and Add-ons

use checkboxgroup to do a search

Federica_92
Communicator

How can I use the checkbox group to set the parameters for a search?
For example:

    var CheckboxGroupView = require("splunkjs/mvc/checkboxgroupview");
    new CheckboxGroupView({
    id: "example-checkboxgroup",
    default: "One",
    el: $("#divToHangOn")
    }).render();

var checkbox[n] = $("#checkbox_id").val()

 var SearchManager = require("splunkjs/mvc/searchmanager");
 new SearchManager({
     id: "search",
    search: "index=main source=checkbox[1] sourcetype=[2] and so on...until n",
    }); 
0 Karma

dfoster_splunk
Splunk Employee
Splunk Employee
new CheckboxGroupView({
    ...
    value: mvc.tokenSafe('$checkboxValue$')
});

new SearchManager({
    ...
    search: mvc.tokenSafe('index=main source=$checkboxValue$')
});
0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...