Splunk Search

How to search top 10 error codes in an environment?

ss78246
New Member

Hi.

I am new to Splunk and was looking for a search which can give me the list of the top 10 error codes occurring in an environment. Could anyone suggest on this?

I think I have to use stats and top commands, but not sure on how to list top 10 error codes.

Regards.

Tags (3)
0 Karma

sundareshr
Legend

Assuming you have the err_cd field extracted, you just need to top command. Try something like this

your base search here | top err_cd | fields - count

This will give you top 10 err_cd, count and percent. The fields - count command will remove the count field from display.

http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Top

0 Karma

ss78246
New Member

HI Sundaresh.

Thanks for the update.
I am searching for error codes from log files in an environment.
How could I separate out only error code from the logs .
I mean error codes can be like err20 or err31 , just an example.

And also could you suggest on how I can use error code as field in top command.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...