Developing for Splunk Enterprise

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

niketnilay
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