Splunk Dev

Reading results data from search done handler .on("search:done", function(){}) in SplunkJS

seva98
Path Finder
Hi, 
 
how do I read results of finished Splunk search in Javascript with following function?
 
mvc.Components.get("search_id").on("search:done", function () { })
Labels (1)
0 Karma

niketn
Legend

@seva98 refer to one of the older answers https://community.splunk.com/t5/Archive/How-to-retrieve-more-than-100-record-in-searchmanager/td-p/1...

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

seva98
Path Finder

Thanks, just one more question. Is there more convenient way to access results without accessing _data attribute?

searchManager.data('results', {count: 0, output_mode: 'json_rows'}).on('data', function(data) {
// Currently I see data there:

const dataFields = data._data.fields
const dataRows = data._data.rows

});

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...