Splunk Search

count the number of KEYWORD

abhayneilam
Contributor

Hi,

I have a file which contains :

HI
bye
HI
hi
BYE

I would like to know how many HI is there in my file which would look like

Hi 3 times
BYE 2 times

0 Karma

kristian_kolb
Ultra Champion

Are they in a field? If so, then it is easy to just make use of the stats command.

your_search | stats count by fieldname

where fieldname is the name of your field.

The result would look like;

fieldname   count
HI          2
hi          1
bye         1
BYE         1

Please provide better samples, to get better help.

/Kristian

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...