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!

Index This | Why did the turkey cross the road?

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

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...