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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...