Splunk Search

To find new added hosts using lookup files

gabrieltrust
Engager

I need to find new added hosts using lookup files.
The solutions in blog didn't work for me.

I will create a lookup file with all my hosts. ( I did)

If any new host will be added , it will be displayed.

Any help will be appreciated.

 

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @gabrieltrust ,

if you have a lookup (called e.g. perimeter.csv) with at least one field (host), you can run something like this:

| tstats count WHERE index=* NOT [ | inputlookup perimeter.csv | fields host ] BY host

Ciao.

giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @gabrieltrust ,

if you have a lookup (called e.g. perimeter.csv) with at least one field (host), you can run something like this:

| tstats count WHERE index=* NOT [ | inputlookup perimeter.csv | fields host ] BY host

Ciao.

giuseppe

gabrieltrust
Engager

Works Great! Thank you

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Get your list of unique hosts, append your list of unique hosts from the lookup file twice, use stats to count by host, where the count is only 1, the host is not in the lookup file, where it is 2 it is only in the lookup file, where it is 3, it is in both the searched events and the lookup file.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...