Splunk Search

Average of ratio of two fields?

travispowell
Path Finder

in source X, I have fields A and B. I want to find the average ratio of two fields per hour. Something like:

source=X * | stats avg(eval(A/B)) by date_hour

...which obviously doesn't work. It says I need to rename something or rather...

Tags (2)
1 Solution

Ron_Naken
Splunk Employee
Splunk Employee

Have you tried it like this:

source=X * | eval ratio=A/B | stats avg(ratio) by date_hour

View solution in original post

Ron_Naken
Splunk Employee
Splunk Employee

Have you tried it like this:

source=X * | eval ratio=A/B | stats avg(ratio) by date_hour

travispowell
Path Finder

I feel like I do this so often. Yes I did try that, but you reminded me I needed to capitalize the fields. I'm positive splunk is case-sensitive.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...