Splunk Search

How to join with search from 2 sources?

garrywilmeth
Explorer

Hi,

I am trying to figure out how to use join to table the results from 2 searches.

sourcetype=AAD_MSGraph_UserData

AAD_OnPremSID
AAD_Email
AAD_UserType
AAD_LastSignInDateTime
AAD_LastNonInteractiveSignInDateTime
AAD_LastPWChange

sourcetype=AD_UserData

AD_SID
AD_UserPrincipalName
AD_LastLogon

JOIN ON:

AAD_OnPremSID AND AD_SID

TABLE RESULTS:

AAD_OnPremSID, AAD_Email, AAD_UserType, AAD_LastPWChange, AAD_LastSignInDateTime, AAD_LastNonInteractiveSignInDateTime, AD_LastLogon

 

Thanks!

Garry

Labels (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @garrywilmeth,

You can use below search without join.

index=your_index sourcetype=AAD_MSGraph_UserData OR sourcetype=AD_UserData 
| eval sid=coalesce(AAD_OnPremSID,AD_SID) 
| stats values(AAD_*) as * values(AD_LastLogon) as AD_LastLogon by AAD_OnPremSID 
| table AAD_OnPremSID AAD_Email AAD_UserType AAD_LastPWChange AAD_LastSignInDateTime AAD_LastNonInteractiveSignInDateTime AD_LastLogon

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

garrywilmeth
Explorer

Hello,

I just got a chance to give this a try.  It populated the SID in the table, but no other data for any of the other columns.

Thanks,

Garry

0 Karma
Get Updates on the Splunk Community!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...