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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...