Splunk Search

Transaction duration not working as expected

dowdag
Engager
| transaction CheckNumber startswith="Tender" endswith="PrintIntercept\:\:PrintXML finished" 
| top  CheckNumber TimeStamp duration Info   showcount=false showperc=false

I am getting back data but the duration column is 0, what did I miss?

0 Karma

evania
Splunk Employee
Splunk Employee

Hi @dowdag ,

Did you have a chance to check out any answers? If it worked, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help you.

Thanks for posting!

0 Karma

niketn
Legend

@dowdag have you tried the following? Also after the transaction command have you validated that the two expected events are getting actually correlated or not? Can you add some sample events for startswith and endswith condition (mock/anonymize any sensitive information)?

 <yourCurrentSearch>
 | transaction CheckNumber startswith="Tender" endswith="PrintIntercept\:\:PrintXML finished" 
 | sort 0 - duration
 | table CheckNumber TimeStamp duration Info   

Ideally you should try using stats for this kind of correlation which should work faster

 <yourCurrentSearch> CheckNumber=* ("Tender" OR "PrintIntercept::PrintXML finished")
 | eval EventType=case(searchmatch("Tender"),"start",searchmatch("PrintIntercept::PrintXML finished"),"finish")
 | stats values(EventType) as EventType min(_time) as _time max(_time) as LatestTime values(Info) as Info by CheckNumber
 | search EventType="Tender" AND EventType="PrintIntercept::PrintXML finished" 
 | eval duration=LatestTime-_time
 | fields - LatestTime
 | sort 0 - duration
 | table CheckNumber _time duration Info
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...