Book Image

Implementing Splunk (Update)

Book Image

Implementing Splunk (Update)

Overview of this book

Table of Contents (20 chapters)
Implementing Splunk Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Calculating events per slice of time


There are a number of ways to calculate events per some period of time. All these techniques rely on rounding _time down to some period of time, and then grouping the results by the rounded buckets of _time.

Using timechart

The simplest approach to counting events over time is simply to use timechart, like this:

sourcetype=impl_splunk_gen network=prod
| timechart span=1m count

In the table view, we see the following:

Charts in Splunk do not attempt to show more points than the pixels present on the screen. The user is, instead, expected to change the number of points to graph, using the bins or span attributes. Calculating average events per minute, per hour shows another way of dealing with this behavior.

If we only wanted to know about the minutes that actually had events instead of every minute of the day, we could use bucket and stats, like this:

sourcetype=impl_splunk_gen network=prod
| bucket span=1m _time
| stats count by _time

The bucket command rounds...