6

When executing a query via the splunk SDK, apparently the results are clipped after 100 entries. How to get around this limit?

I tried:

>job = service.jobs.create(qstring,max_count=0, max_time=0, count=10000)
>while not job.is_ready():
    time.sleep(1)
>out = list(results.ResultsReader(job.results()))
>print(len(out))
100

but the same query in the splunk web interface produces over 100 lines of results.

mdurant
  • 27,272
  • 5
  • 45
  • 74

2 Answers2

4

Try job.results(count=0) count=0 means no limit.

AEM
  • 41
  • 1
1

Here is a hack which appears to work (but this is surely not the right way to do this):

in splunklib.binding

HttpLib.get and HttpLib.post, add the following line to the beginning of each method:

kwargs['count'] = 100000
mdurant
  • 27,272
  • 5
  • 45
  • 74