Splunk Search

Count field value occurences

niuk
Engager

I have search result like below with repeating values in 'src _ip' field

niuk_0-1602168210032.png

and looking to count occurrences of field values 

10.1.8.5          3

10.3.20.63     1

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @niuk,

try something like this:

your_search
| stats count BY src_ip
| sort -count

I hint to follow the Search Tutorial (https://docs.splunk.com/Documentation/Splunk/8.0.6/SearchTutorial/WelcometotheSearchTutorial)to learn how to impement searches.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @niuk,

try something like this:

your_search
| stats count BY src_ip
| sort -count

I hint to follow the Search Tutorial (https://docs.splunk.com/Documentation/Splunk/8.0.6/SearchTutorial/WelcometotheSearchTutorial)to learn how to impement searches.

Ciao.

Giuseppe

Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...