Splunk Search

Top N results in table

ponsakthi
Engager

The intermediate result of a query is

Machine | ErrorType |ErrorCount
A | ErrorA | 4
A | ErrorB | 3
B | ErrorC | 6
B | ErrorD | 3
C | ErrorE | 3
C | ErrorF | 9

I want to show the top 1 result(in terms of Error count) per machine. The result should be like

Machine | ErrorType |ErrorCount
A | ErrorA | 4
A | ErrorC | 6
B | ErrorF | 9

I tried using "top 1 ErrorCount by Machine" but it is trimming other useful fields like ErrorType.
How do I achieve this?

Tags (1)
0 Karma

somesoni2
Revered Legend

Give this a try

your current search giving Machine, ErrorType ,ErrorCount | sort 0 Machine,-num(ErrorCount) | dedup Machine
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...