Getting Data In

How to put together a listing of hosts, forwarder version and Index the hosts belong to in a search?

NanSplk01
Communicator

So far I can get the hosts and forwarder version, but I am unable to get the index the forwarders belong to:

index="_internal" source="*metrics.lo*" group=tcpin_connections fwdType=uf | dedup hostname| table hostname,version,os

How can I tie the above with the index that the hosts belong to?

 

Labels (3)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @NanSplk01,

as @richgalloway said Hosts do not "belong" to an index.  Data is stored in indexes ("belongs" in the index).  Host is just one piece of metadata associated with an event.  It's possible for a given host to be in many events and, possibly, in many indexes."

You could correlate the information about index to the host using another search where your search is a part:

(index="_internal" source="*metrics.lo*" group=tcpin_connections fwdType=uf) OR (index=*)
| eval hostname=coalesce(hostname,host)
| stats 
   values(index) AS index 
   values(version) AS version 
   values(os) A os 
   BY hostname
| table hostname version os index

Ciao.

Giuseppe

0 Karma

bray1111
Explorer

I found a typo in the search and the use of index=* is inefficient so I altered it slightly to use the 'per index thruput' group to get index info from the internal index.  I do see some field dropout in my environment but this works.

index="_internal" source="*metrics.lo*" (group=tcpin_connections fwdType=uf) OR group=per_index_thruput
| eval hostname=coalesce(hostname,host)
| stats
values(series) AS index
values(version) AS version
values(os) AS os
BY hostname
| table hostname version os index

richgalloway
SplunkTrust
SplunkTrust

Hosts do not "belong" to an index.  Data is stored in indexes ("belongs" in the index).  Host is just one piece of metadata associated with an event.  It's possible for a given host to be in many events and, possibly, in many indexes.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...