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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...