Splunk Search

How do I get total count of a field per host?

amit2312
Engager

Hi,

I am new to splunk, this might have asked and answered but didn't get the answer when i searched it. here is my query: I have a base query, which basically gets the ids field(ex : 1234,3213) from different hosts. i want to get the total number of ids per host. 

data:

host : ids: price: details

xyz:123:$45:example 

cds:143:$45:example

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Use the stats command for that.

| stats count(ids) by host

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

As @richgalloway but if you want unique ids, use dc(ids)

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use the stats command for that.

| stats count(ids) by host

 

---
If this reply helps you, Karma would be appreciated.

amit2312
Engager

Thanks a lot for your help. it worked.

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...