I have created a saved search that runs every minute. I have opted to run a perl script as the alert option. Splunk passes in the search id to the script as one of it's parameters. Whenever I try to retrieve the events via REST, I get a blank page.
Here's what I run to get the events:
I AM able to get the RESULTS though:
Splunk tends to kick off searches in the most efficient way possible. One way it speeds things up is that any fields that aren't referenced in the search wont be extracted or summarized. But another way is that unless someone sets the 'status_buckets' argument (on the dispatch POST) to something greater than 0, then it will preserve only the final
results -- it wont preserve the raw events nor any bucketed summary information by time.
Note of course, if the search you are running does NOT have any reporting commands on it, the results and the events are the same -- ie you'd get the exact same results from the
results endpoint as you would from the
But anyway when you're running scheduled reports, just set
dispatch.buckets = 1
and that will basically tell Splunk to keep the events around, accessible through the
events endpoint, and incidentally also the field summaries around, accessible through the
You can see a little more background in this other answer:
And the UI Examples app has some pages talking about how
status_buckets and it's cousin
required_field_list are set by the views, and how this can effect performance. For more reading there pull down the "ui examples" app from Splunkbase and under "Advanced XML" you'll see several views with examples and docs, called "Affecting Search Performance".
And they are mentioned briefly in the REST docs although really I wish it would explain them a little more: