Splunk Search

Count per host

EH
Engager

I'm trying to rename the IP's of our servers to splunknodes

host_ip host_name

ip-111-11-1-11Searchhead
ip-111-11-1-12Searchhead
ip-111-11-1-10Masternode
ip-111-11-2-11Indexer
ip-111-11-2-12Indexer
ip-111-11-2-10Deploymentserver


How do I get it to count the duplicates?:

host_ip host_name

ip-111-11-1-11Searchhead1
ip-111-11-1-12Searchhead2
ip-111-11-1-10Masternode
ip-111-11-2-11Indexer1
ip-111-11-2-12Indexer2
ip-111-11-2-10Deploymentserver

 

Thanks in advance!

Labels (3)
0 Karma
1 Solution

rafadvega
Path Finder

Hi!! try this:

 

your search
| streamstats count by host_name
| eval host_name=host_name.count
| fields - count

 

rafadvega_0-1636731797517.png

 

View solution in original post

rafadvega
Path Finder

Hi!! try this:

 

your search
| streamstats count by host_name
| eval host_name=host_name.count
| fields - count

 

rafadvega_0-1636731797517.png

 

Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...