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
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...