Splunk Search

How to find the average count of events for a timechart?

robertlabrie
Path Finder

This sounds so easy but I can't seem to figure it out. Or maybe it's just ridiculous and there is a better way.

So I have

index=iis | timechart count by cs_uri_stem

And that's great, but what if I want to smooth out the timechart with an average? Or maybe just plot the deltas? Doing avg(count(_raw)) doesn't cut the mustard. Basically I want to try and stomp down the occasional spikes (which yes need attention in some circumstances) and just get an idea if hitcount is trending up. Any ideas?

Tags (3)
0 Karma

Sukisen1981
Champion

| timechart span=1h count as events | eventstats sum(events) as z| eventstats count(events) as y |eval average=round(z/y,2)|fields

Ultimately the average = sum/count

0 Karma

Sukisen1981
Champion

| timechart span=1h count as events | eventstats sum(events) as z| eventstats count(events) as y |eval average=round(z/y,2)|fields

0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee
0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

Have you looked at X11 ? Or trendline ? Trendline has exponential moving averages as well as weighted moving averages.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...