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
SplunkTrust
SplunkTrust

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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...