Splunk Search

How to join 2 different source tyoe using identity column?

muguniya
Explorer

Hi All,

We have 2 different sourcetype master and child need to join/append the source type on identity column master.id and child.mastertable_id. Please let us how can we display the result in search query using table format.

sourcetype=master :
id(pk)|filename|status
123|test1.txt|S
124|test2.txt|F
125|test3.txt|S
126|test4.txt|F

sourcetype=child :
id|mastertable_id(FK)|msg
221|124|connectivity issue
223|126|user aborted

Final result should look like:
id|filename|status|childid|msg
123|test1.txt|S|NA|NA
124|test2.txt|F|221|connectivity issue
125|test3.txt|S|NA|NA
126|test4.txt|F|223|126|user aborted

Thanks

Tags (3)
0 Karma

HiroshiSatoh
Champion

What with this?

(your search)|rename id as childid|rename mastertable_id(FK) as id|rename id(pk) as id|stats max(filename) as filename,max(status) as status,max(childid) as childid,max(msg) as msg by id

0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...