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 Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...