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!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...