Splunk Search

How to efficiently calculate max events per second (eps) by hour over long timeranges, like 30 days?

the_wolverine
Champion

I could count against the raw data but it takes a long time. How can I more efficiently count on such stats?

1 Solution

the_wolverine
Champion

Use tstats and specify the variables:

  • index=main
  • earliest=-30d
  • groupby (_time, sourcetype)
  • span=1s

    | tstats count as COUNT where index=main earliest=-30d by _time,sourcetype span=1s | timechart span=1h max(COUNT) as eps by sourcetype

View solution in original post

the_wolverine
Champion

Use tstats and specify the variables:

  • index=main
  • earliest=-30d
  • groupby (_time, sourcetype)
  • span=1s

    | tstats count as COUNT where index=main earliest=-30d by _time,sourcetype span=1s | timechart span=1h max(COUNT) as eps by sourcetype

awurster
Contributor

might suggest a reformat (note in my search i do index=*😞

| tstats count as COUNT where index=* earliest=-30d by _time, sourcetype span=1s
  | timechart span=1h max(COUNT) as eps by sourcetype

thambisetty
SplunkTrust
SplunkTrust

FYI -
earliest=-30d and span=1s will produce 1 day = 86400 seconds * 30 days = 2,592,000 

tstats will limit results to 50,000 hence the output of the search will truncate results.

————————————
If this helps, give a like below.
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...