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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...