Splunk Search

Join is not returning events if subsearch is empty. How to fix it

denissotoacc
Path Finder

I have an Index called myindex:

NAMEAGECITYCOUNTRYLEGAL AGE
Denis17LondonUKNO
Denis18  YES
Maria17RosarioArgentinaNO
Maria18  YES
Nani11ParisFranceNO

 

This is a basic example. The case is when LEGAL AGE=NO, there are several more fields available than when LEGAL AGE=YES. Notice that when LEGAL AGE=YES the field "CITY" and "COUNTRY" didn't exists at all.

What I need to get are all the people of this index with all the information EVEN if they are not in LEGAL AGE.

I use a join for this:

 

index=myindex "LEGAL AGE"=NO
| join NAME
        [ search index=myindex "LEGAL AGE"=YES ]

 


The problem is that it is working only if the subsearch returns something. In this example, it will work for Denis and Maria, but not for Nani. How can I make it works even if subsearch is returning nothing?

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

I think the problem is the join command defaults to an inner join.  Try join type=outer NAME ...

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

I think the problem is the join command defaults to an inner join.  Try join type=outer NAME ...

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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