Splunk Search

How do you compare several values to get the highest one?

sant1ago
New Member

Hello,

I want to compare several values to get the highest one. For example:

index   /      count
...............................
aaa           11716
bbb           30317
ccc            45
.
.
.    
zzz           1568

In this case the return for the query would be:

index   /      count
...............................
bbb           30317

Can someone help me please?

0 Karma
1 Solution

493669
Super Champion

Try this:

 | stats max(count) as count

OR

| eventstats max(count) as max|where count=max

View solution in original post

0 Karma

493669
Super Champion

Try this:

 | stats max(count) as count

OR

| eventstats max(count) as max|where count=max
0 Karma

sant1ago
New Member

thank you so much! It worked perfectly 😃

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...