Splunk Search

Return results if join has no results.

becksyboy
Contributor

Hi all,

I have a search with a Join. For the event I am Joining the Master search may not always have corresponding events in the join/subsearch. 

Is it possible to also return the results from the master search if the join does not find corresponding events?

index=*azure* *#EXT#* Operation="Add member to group."
|spath output=groupname path=ModifiedProperties{1}.NewValue
|spath output=TID path=Target{1}.ID 
|eval time=strftime(_time,"%H:%M:%S %d-%m-%Y")
|rename UserId as src_user
|stats earliest(time) as start_time latest(time) as last_time values(Operation) as operation values(ObjectId) as dest_user by groupname,src_user, TID
|  rename operation AS operation1
| table start_time, last_time, operation1, groupname, src_user, dest_user, TID
| join TID 
    [search index=*o365*
|spath output=TID path=Parameters{1}.Value
|eval time=strftime(_time,"%H:%M:%S %d-%m-%Y")
|rename UserId as src_user
|stats earliest(time) as start_time latest(time) as last_time values(Operation) as operation  values(ObjectId) as dest_group by src_user, TID]
|table start_time, last_time, src_user, operation, operation1, dest_group, groupname, dest_user TID
Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @becksyboy ,

only to answer to your question: as you can read at https://help.splunk.com/en/splunk-enterprise/spl-search-reference/9.2/search-commands/join#id_62219e... try with 

type=left

to perform a left join.

Anyway, try to avoid to use the join command that's very slow, try to correlate events using stats.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @becksyboy ,

only to answer to your question: as you can read at https://help.splunk.com/en/splunk-enterprise/spl-search-reference/9.2/search-commands/join#id_62219e... try with 

type=left

to perform a left join.

Anyway, try to avoid to use the join command that's very slow, try to correlate events using stats.

Ciao.

Giuseppe

becksyboy
Contributor

Thanks this works perfectly, i will read the link.

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

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