I need to build a js script that will run a splunk search when I click a button on my dashboard.
The search within the .js file needs to: (1) get a token I have set on the dashboard which is $host_tok$ and (2) append the search results to a kv store (named: collected-data) I already have setup.
I would also like the js script to ask for confirmation (yes/no) "Are you sure you want to add $host_tok$ data to the collected-data kv store?" Clicking yes will run the search. Clicking no will close the notification window.
I have a basic understanding of js, but I don't work with it enough to remember how I would build this script.