Splunk Search

Compare Lookup CSV with Search

sumit29
Path Finder

Dear Experts ,

I have created the Lookup Hostname.csv(Contain only one field Hostname) which contain 100 number of hosts. I need to write a search to compare the hostname.csv with current search(List of unique hostname ) to get the new hostname come to network comparing with hostname.csv.

Lets say 101 , a new host came to network . Need to compare with hostname.csv . Display in search output

0 Karma
1 Solution

HeinzWaescher
Motivator
sourcetype=foo NOT [inputlookup hostname.csv | fields+ host]
| stats values(host) AS new_hosts

The subsearch will exclude all known hosts from the list, so only new hosts are shown in the results

View solution in original post

HeinzWaescher
Motivator
sourcetype=foo NOT [inputlookup hostname.csv | fields+ host]
| stats values(host) AS new_hosts

The subsearch will exclude all known hosts from the list, so only new hosts are shown in the results

Michael
Contributor

hmm, did not work for me until I did:

index=blah [inputlookup hostname.csv | table host] | stats values(host) AS "Hosts appearing in Splunk, not on my list"

didn't use the "fields+"

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...