我正在使用此命令在 my_field 上从 Splunk 获取前 200 个结果:
q = "search index=idx host=nets* mydomain.com | top limit=200 my_field"
当我在 Splunk 中运行它时,它给了我 200 个结果。但是,当我使用 Splunk Python SDK 运行它时,我只得到 100 个结果。
service = client.connect(host=HOST, username=USER, password=PASS)
extra_args = {"earliest_time": "-1h",
"latest_time": "now"}
q = "search index=idx host=nets* mydomain.com | top limit=200 my_field"
res = service.jobs.oneshot(q, **extra_args)
reader = results.ResultsReader(res)
top_jobs = []
for row in reader:
top_jobs.append(row['my_field'])
print len(top_jobs) # always returns 100, or any number less than 100 that is specified in the query.
有没有其他方法可以指定结果的数量?