This came from a customer that wanted a way to send the entire result set from a search inside the email message body, instead of a CSV, HTML, or PDF attachment.
More importantly, customer wanted to specify a general template that could be used to format how each row of the result set would look in the message body. AND include the result set row number in each iteration.
eval event_count_1 initializes that count.
accum event_count keeps a running total, which get's printed with each iteration through the result set.
Here's a great blog on accum: https://www.splunk.com/blog/2014/05/16/search-commands-accum.html
... View more