Splunk Search

How to join filtering search

martaBenedetti
Path Finder

Hi community,

starting form a custom commands that returns a list of hostnames, I have the need to filter out:

  • platform != osx
  • domain NOT IN ("domain2", "domain3")
  • domain=domain1 hostname IN ("host1*","host2*") 

 

In order to do so I'm trying different versions but I can't get the result I want. 

With this search I can olny get these domain=domain1 hostname IN ("host1*","host2*")  but all the hostname in a different domain than domain2 and domain3 are missing.

 

 

 

| getfe
| search platform != "osx" (domain =domain1 hostname IN ("host1*","host2*")) 
| append 
    [search NOT domain IN ("domain2", "domain3", "domain1")]

 

 

 

 

Can you please help me? I know I'm missin

 

Thanks a lot

Marta

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

yannK
Splunk Employee
Splunk Employee

what about an OR condition ?

 

( platform != osx ) 
AND  
( ( domain NOT IN ("domain2", "domain3") OR ( domain=domain1 hostname IN ("host1*","host2*") ) )

View solution in original post

yannK
Splunk Employee
Splunk Employee

what about an OR condition ?

 

( platform != osx ) 
AND  
( ( domain NOT IN ("domain2", "domain3") OR ( domain=domain1 hostname IN ("host1*","host2*") ) )

martaBenedetti
Path Finder

Yeah, actually I complicated my self....though of the OR condition this morning 😄

Thanks anyway!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...