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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...