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!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

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 ...