Hello Everyone,
First off, thanks in advance to everyone who takes the time to contribute to this post!
I've got custom html code in simple xml and was able to grab data from a textpart and parse it into a JavaScript variable captured using the code below. I'm trying to use the variable captured in the search query in the SearchManager function. So far I've only been able to set static values such as eval test = "Working" but have had no luck passing in a JavaScript variable.
require([
"underscore",
"splunkjs/mvc/searchmanager",
"splunkjs/mvc/simplexml/ready!",
], function(_, mvc, SearchManager) {
var mysearch = new SearchManager({
id: "mysearch",
autostart: "false",
search: '| makeresults | eval test = captured | collect index = "test_index"'
});
$("#btn-submit").on("click", function () {
// Capture value of the Text Area
var captured = $("textarea#outcome").val();
mysearch.startSearch();
});
});
});
... View more