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!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...