I customize a dashboard page and I put a submit button on it.How can I use the Javascript monitor the button's click to send a request to Splunk and have Splunk execuse a SPL?
This is my Js code:
require([
"jquery",
], function ($) {
$(document).on('click', '#btn_submit',
function () {
setTimeout(function time() {
var temp_a = document.getElementById('temp_a').value
var temp_b = document.getElementById('temp_b').value
},
100);
});
});
and the dashboard source code is:
<dashboard script="test.js">
<label>test_js_action</label>
<row>
<panel>
<html>
<div>
<button id="btn_submit">submit</button>
</div>
</html>
</panel>
</row>
</dashboard>
By the way, I saw a sample using the splunkjs/mvc to send request ,but I cant't get whole code. only know the Js head is:
require([
"jquery",
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"
], function ($, mvc) {
Thank you very much if you could provide a solution.🌹
... View more