Knowledge Management

how to get the list of hostname in one index that are not in another index in splunk

harishsplunk7
Explorer

We want all the hosts in index=aws that are NOT in index=windows. 


Example : 

| tstats count where index=aws by host | table host
| search NOT [| tstats count where index=windows by host | table host]

Labels (6)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi, please try this:

| tstats 
   dc(index) AS index_count 
   WHERE index IN (aws,windows) 
   BY host
| where index_count=2
| table host

Ciao.

Giuseppe

0 Karma

burwell
SplunkTrust
SplunkTrust

Hi. Your search is so close to what I do.. change search -> where

 

| tstats count where index=aws by host | table host
| where NOT [| tstats count where index=windows by host | table host]
0 Karma
Get Updates on the Splunk Community!

Troubleshooting the OpenTelemetry Collector

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

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...