Splunk Search

How to retrieve more than 100 record in searchmanager

chrismok
Path Finder

Currently, the dashboard is build in HTML dashboard with javascript, but I found that the searchmanager is only return not more than 100 rows in js. May I know how to control the return no.

 var r = searchmanager1.data('results');
 searchmanager1.on('search:done', function(state,job) {

    console.log('total:' + state.content.resultCount); //Return 270 or more

});

r.on('data', function(results) {
        console.log('length:' + r.data().rows.length); // Only return 100
    });
Tags (1)

AndrewEvelopers
Explorer

Uh I've found it on some github code:

searchManager.data('results', {count: 0, output_mode: 'json'}).on('data', parseData);

bhawkins1
Communicator

In my case I had to use 'json_rows', like so:

searchManager.data('results', {count: 0, output_mode: 'json_rows'}).on('data', parseData);

akath_splunk
Splunk Employee
Splunk Employee

Thank you! This answer saved me a lot of time 🙂

0 Karma

sibrahim
Engager

I signed in just so I could say thank you, you have saved me a whole lot of stress.

0 Karma

AndrewEvelopers
Explorer

Same problem. No ideas?

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...