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!

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 ...

Introducing the 2024 Splunk MVPs!

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