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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...