Splunk Search

Perform an operation on values in the column of a lookup table that share the same row values

matthewob5
Engager

I have a lookup table that looks like this (:

Column 1Column 2Column 3Column 4
Value 1--15
Value 1--60
Value 2--75
Value 2--N/A
Value 2--5

 

I want to calculate the average for all of the values in Column 4 (that aren't N/A) that have the same value in Column 1. Then I want to output that as a table:

Column 1Column 2
Value 137.5
Value 240
Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The stats command can do that, although I'm not sure how it will handle "N/A".

| stats avg('Column 4') as "Column 2" by 'Column 1'

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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