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 + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...