Splunk Search

How to get duration from start and time two different events and different index based on the common filed?

Sekhar
Explorer

I have two events one is 

Index=x source type= xx "String" extacted fields s like manid,actionid,batch I'd

2nd event 

Index=y source type=y " string recived" extacted fields like manid ,actionid

 

Calculate the time from 2nd event -1 event . 

While calculating the time mandid should same 

 

Labels (1)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

Something like

(index=x source type= xx "String") OR (index=y source type=y " string recived")
| stats values(_time) as time values(actionid) as actionid values(batchid) as batchid by manid
| eval duration = max(time) - min(time)

View solution in original post

Tags (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Something like

(index=x source type= xx "String") OR (index=y source type=y " string recived")
| stats values(_time) as time values(actionid) as actionid values(batchid) as batchid by manid
| eval duration = max(time) - min(time)
Tags (1)
0 Karma

Sekhar
Explorer

Result getting fine but want based on the below condition 

Calculate the diffe bw start event and end event grouped by manid. And count number mandate exceeding different above 30 seconds 

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Then you add calculation based on duration.

| eval excessive = if(duration > 30, duration, null())
| stats count(excessive) as excess_count avg(excessive) as excess_avg by manid
0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...