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!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...