Splunk Search

How do I apply leftouter join into two diffetent search

govindparashar1
New Member

I needs to apply left outer join or NOT IN condition on two different search

search 1 :
index=abc host="xxx" sourcetype=access_combined_wcookie NOT (sessionId="-" OR isnull(sessionId)) method=GET
uri_path="/x/y/z*" | rex field=uri "^(?:[^/\n]*/){4}(?P\d+)" | eval pk=sessionId+CTM | dedup pk | table pk

Search 2:
index=def sourcetype=referral_activity APPOINTMENT_BOOKING_BOOKED | eval pk =substr(session_id, 9)+ctm | table pk |

join type=inner pk [search index=abc host="xxx" sourcetype=access_combined_wcookie NOT (sessionId="-" OR isnull(sessionId))
method=POST uri_path="/x/y/w*" | rex field=uri "^(?:[^/\n]*/){4}(?P\d+)" | eval pk=sessionId+CTM | dedup pk | table pk ]

Expected results : Unique pk values from search 1 which is not present into search 2 results

Please advise..

0 Karma

chimell
Motivator

Hi
Try this

 index=abc host="xxx" sourcetype=access_combined_wcookie NOT (sessionId="-" OR isnull(sessionId)) method=GET 
    uri_path="/x/y/z*" | rex field=uri "^(?:[^/n]*/){4}(?Pd+)" | eval pk=sessionId+CTM | dedup pk | table pk|appendcols[search index=def sourcetype=referral_activity APPOINTMENT_BOOKING_BOOKED | eval pk =substr(session_id, 9)+ctm | table pk | 
    join type=inner pk [search index=abc host="xxx" sourcetype=access_combined_wcookie NOT (sessionId="-" OR isnull(sessionId)) 
    method=POST uri_path="/x/y/w*" | rex field=uri "^(?:[^/n]*/){4}(?Pd+)" | eval pk=sessionId+CTM | dedup pk | table pk ]]
0 Karma

somesoni2
Revered Legend

Try like this

index=abc host="xxx" sourcetype=access_combined_wcookie NOT (sessionId="-" OR isnull(sessionId)) method=GET 
uri_path="/x/y/z*" | rex field=uri "^(?:[^/n]*/){4}(?Pd+)" | eval pk=sessionId+CTM | dedup pk | table pk | eval From=1 
append [search index=def sourcetype=referral_activity APPOINTMENT_BOOKING_BOOKED | eval pk =substr(session_id, 9)+ctm | table pk | 
join type=inner pk [search index=abc host="xxx" sourcetype=access_combined_wcookie NOT (sessionId="-" OR isnull(sessionId)) 
method=POST uri_path="/x/y/w*" | rex field=uri "^(?:[^/n]*/){4}(?Pd+)" | eval pk=sessionId+CTM | dedup pk | table pk ] | eval From=2]| stats values(From) as From by pk | where mvcount(From)=1 AND From=1
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...