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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...