Splunk Search

Running SearchManager in a dashboard, I get 165 results, but why does SplunkResultsModel only return the first 100 events?

P_A_WORKS
New Member

Hi,

After I run a SearchManager in dashboard, the number of result events I see is 165, however, when I use the following code to retrieve the results data:

var myResults = initSearch.data("results");
var searchResultArray = myResults.data().rows;

searchResultArray only has the first 100 events. Why is that ? Anyone run into this problem? How to get all events back?

thanks

0 Karma
1 Solution

Yasaswy
Contributor

Hi, you will need to pass count: 0 in your search parameters to get all results... refer here
Eg... for a One Shot search

var searchParams = {
earliest_time: "2011-06-19T12:00:00.000-07:00",
latest_time: "2012-12-02T12:00:00.000-07:00",
count : 0 <-- Add this
};

View solution in original post

Yasaswy
Contributor

Hi, you will need to pass count: 0 in your search parameters to get all results... refer here
Eg... for a One Shot search

var searchParams = {
earliest_time: "2011-06-19T12:00:00.000-07:00",
latest_time: "2012-12-02T12:00:00.000-07:00",
count : 0 <-- Add this
};

P_A_WORKS
New Member

hey, I finally find documentation about how to set this parameter "count" in my case... a place so easy to ignore, and set "count" to 0 does solve the problem, thanks for your help 🙂

0 Karma

Yasaswy
Contributor

Good to hear on a Friday morning 🙂 .... have a nice weekend.

0 Karma

P_A_WORKS
New Member

haha...you too 🙂

0 Karma

P_A_WORKS
New Member

thanks for your replay 🙂

but in my case, I'm not using the javascript SDK, I'm using this :

http://docs.splunk.com/Documentation/WebFramework

and I don't find a property of "count" or similar ones in the SearchManager document page...

0 Karma

Yasaswy
Contributor

hi,
you should be able to try something like:
var myResults = mainSearch.data("events", { count: n});

check out the method data( results_type, { attributes } ) ... here

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

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 ...