Splunk Search
Highlighted

Transaction duration not working as expected

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
Highlighted

Re: Transaction duration not working as expected

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
0 Karma
Highlighted

Re: Transaction duration not working as expected

Moderator
Moderator

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
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.