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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...