Splunk Search

How to count numbers of records per category from a table?

splunkrocks2014
Communicator

Hi. I have a search result returned as the following:

name   type   col_1   col_2   col3
====   ====   =====   =====   =====
N1     T1      A        A       C
N1     T2      A        B       D
N2     T1      D        D       C

How to count numbers of "A", "B", "C", and "D"? For example, the result looks like this:

new_field    count
=========    =====
A             2
B             1
C             2
D             3

Any helps are great appreciated.

Thanks.

0 Karma
1 Solution

sundareshr
Legend

Try this

base search | fields - type | untable name fields values | stats count by values

View solution in original post

0 Karma

sundareshr
Legend

Try this

base search | fields - type | untable name fields values | stats count by values
0 Karma

splunkrocks2014
Communicator

wow, thank you very much for your help!!!

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...