Splunk Search

Matching field from two different index and source

Sekhar
Explorer

I have two event start event having extracted fields from log  managerid ,branch I'd,empname using index = emp source = empsource " offer letters"

End event having extracted field empid,branch id index= manager source= manager source " relieving letters" 

I want to get empid who's is taken offer letter and relieving later and duration.

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Sekhar,

let me understand, you can correlate events using the id field or there some other corrrelation rule?

if you can use id to correlate events, you could try something like this:

(index=emp source=empsource " offer letters") OR (index=manager source=manager source " relieving letters")
| stats 
   earliest(_time) AS earliest
   latest(_time) AS latest
   values(branch) AS branch
   values(managerid) AS managerid
   values(empname) AS empname 
   BY id
| eval diff =latest-earliest,
| eval earliest=strftime(earliest,"%Y-%m-%d %H:%M:%S"), latest=strftime(latest,"%Y-%m-%d %H:%M:%S")

Ciao.

Giuseppe

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 ...