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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...