Hello Guys,
I have weird problem with Javascript after the latest upgrade(8.2.8 to 9.0.6).
Javascript Code
var queryResults = smAlerteGetter.data("results");
console.log("Search done", queryResults);
console.log("pimba - ---- " + JSON.stringify(queryResults));
// when we have the result
queryResults.on("data", function()
{
console.log("Data received");
We should received the events and should see the log "Data received".
The query goes well and we can see in the Activity Jobs that we received our events.
However we have other splunk apps with similar scripts that have the correct behavior.
Do we miss something in our app or configurations related to Javascript ?
Please help!
It should work. Can you please just compare your code with my code.
var mySearch = mvc.Components.get("mySearch");
var mySearchResults = mySearch.data("results");
mySearchResults.on("data", function () {
resultArray = mySearchResults.data().rows;
// Iterate Result set
$.each(resultArray, function (index, value) {
console.log(index, value)
console.log(index, value[0])
console.log(index, value[1])
console.log(index, value[2])
})
});
I hope this will help you.
Thanks
KV
If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.
First of all @kamlesh_vaghela Thank you so much for trying to help,
But we can't enter in:
mySearchResults.on("data", function () {
resultArray = mySearchResults.data().rows;
// Iterate Result set
$.each(resultArray, function (index, value) {
console.log(index, value)
console.log(index, value[0])
console.log(index, value[1])
console.log(index, value[2])
})
});
We can get the action and the results of this Data.
Thanks again