Splunk Search

help for retrieving events not found from a lookup list

jip31
Motivator

Hello

I use the search below in order to display the list of HOSTNAME which have a SITE field that matches

 

 

| inputlookup lookup_cmdb 
| search HOSTNAME= aaa
    OR HOSTNAME= bbb
    OR HOSTNAME= ccc
    OR HOSTNAME= dddd
| stats values(SITE) as SITE by HOSTNAME
| table HOSTNAME

 

Instead the host which have a SITE field that matches, I would like to display the host list that have no SITE field

How to do please?

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| inputlookup lookup_cmdb 
| search HOSTNAME= aaa
    OR HOSTNAME= bbb
    OR HOSTNAME= ccc
    OR HOSTNAME= dddd
| search NOT SITE="*"

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| inputlookup lookup_cmdb 
| search HOSTNAME= aaa
    OR HOSTNAME= bbb
    OR HOSTNAME= ccc
    OR HOSTNAME= dddd
| where isnull(SITE)
0 Karma

jip31
Motivator

I have already tested it but like this I have no results......

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| inputlookup lookup_cmdb 
| search HOSTNAME= aaa
    OR HOSTNAME= bbb
    OR HOSTNAME= ccc
    OR HOSTNAME= dddd
| where isnull(SITE) OR SITE=""
0 Karma

jip31
Motivator

@ITWhisperer wrote:

 

| inputlookup lookup_cmdb 
| search HOSTNAME= aaa
    OR HOSTNAME= bbb
    OR HOSTNAME= ccc
    OR HOSTNAME= dddd
| where isnull(SITE) OR SITE=""

 


no results too...

Tags (1)
0 Karma

jip31
Motivator

| where isnotnull(SITE) works but not | where isnull(SITE)

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| inputlookup lookup_cmdb 
| search HOSTNAME= aaa
    OR HOSTNAME= bbb
    OR HOSTNAME= ccc
    OR HOSTNAME= dddd
| search NOT SITE="*"
Get Updates on the Splunk Community!

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...