I try to make the function wait
for the Query result but I never get the result. I always have
a Promise {Pending} and later the Query to Splunk Done is displayed. How do I make the program wait for the result?
I want to wait for the result and then send the result to a bot.
async function esperate () {
var variable = splunk_normal(Query_splunk, () =>{
console.log('Query to Splunk Done');
//exports results from Splunk SDK
const newLocal = myModule.resultados
var results2 = newLocal;
return results2;
});
console.log("one");
return variable;
}
var mirar = esperate();
console.log(variable);