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!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...