Splunk Search

Is it possible to get duration in milliseconds when charting a transaction

tomhowe
New Member

We are pushing in [json] events with a timestamp field that contains time since epoch in milliseconds, eg:
{[-]
name : "fetch.thing",
correlationId: 'xyz',
timestamp : 1366040759635
}

when I try to do query :
* | spath name | transaction correlationId | chart max(duration) by correlationId

The durations are all 0 despite the timestamps not being the same.
I suspect this is because the duration is in seconds.

Is this the case?

If so, is it possible to display duration in milliseconds?

Thanks, Tom

Tags (1)
0 Karma

Ayn
Legend

As far as I know you can only get durations in seconds from the transaction command. But, transaction is expensive and can often be replaced with stats like this in this case. And, you get the benefit of solving your problem while you're at it 🙂

This should do it (obviously untested though):

* | spath | stats range(timestamp) as durationms by correlationId | eval duration=durationms/1000
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...