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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...