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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...