Splunk Search

How to edit my search to get a weighted average based on total event count?

vernak2539
New Member

New to splunk, so if any more info needs to be provided, please let me know.

I'm trying to get a weighted average, but I cannot seem to get the total number of events.

The search I'm running is below

... | STATS count, median(request_time) by request

The count is equal to the count of the "requests". I would like it to be equal to the count of the total events so I can use it later in the search. I've tried almost everything I can think of and most things about weighted averages on this forum. Any help would be much appreciated.

0 Karma
1 Solution

cmerriman
Super Champion
...|eventstats count as total | stats max(total) as totalEvents count, median(request_time) by request

that would bring back the total events and then the count of events by request. is that what you're looking for?

View solution in original post

0 Karma

cmerriman
Super Champion
...|eventstats count as total | stats max(total) as totalEvents count, median(request_time) by request

that would bring back the total events and then the count of events by request. is that what you're looking for?

0 Karma

vernak2539
New Member

you are a lifesaver!

0 Karma
Get Updates on the Splunk Community!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...