@tdiestel, Since the multiselect value just assigns the first selected value as token and ignores the remaining selected multivalues.
Following JavaScript can be used to iterate through the multi values and return selected comma separated values.
PS: The example is from HTML Dashboard, but the same can be modified for SplunkJS as well.
input2.on("valueChange", function(e) {
var loopCounter;
for(loopCounter=0;loopCounter<e.data.length;loopCounter++)
{
var tmpMultiValue;
if (e.value[loopCounter] !== undefined) {
if(tmpMultiValue == undefined){
// First time initialize temporary multivalued data
tmpMultiValue=e.value[loopCounter];
}else{
// Prepare comma separated multivalued data
tmpMultiValue=tmpMultiValue+","+e.value[loopCounter];
// Original code untouched.
// Sets first value. If iterated over data objects (cumulative) this might populate multivalued data.
EventHandler.setToken("multiSelect", "$value$", {}, e.data);
}
}
}
// Custom multi valued token multiValue set using SplunkJS Token Handler.
// May need to change from default to submitted Token handler as required.
var tokens = mvc.Components.get("default");
tokens.set("multiValue", tmpMultiValue);
});
Once multiValue token is populated the same can be passed to a dummy Splunk Search to iterate and split as multi valued using comma and then expanded as single value results.
... View more