Splunk Enterprise

Javascript after upgrade Splunk 9.0.6

alvesri
Engager

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!

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@alvesri 

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.

 

0 Karma

alvesri
Engager

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

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...