Splunk Search

Finding Timings Between Multiple Events

Razziq
Explorer

Hello,

I am trying to find the timings between multiple calls under the same extracted field of InterchangeId. When using streamstats range(_time), I get the timing between the calls, however the first call in order of time has the total time and the last call has a 0 value. I am trying to determine how long it takes between each call in the correct order without it aggregating one of the calls to the total timing value.

Below is a screenshot of the results as well as the search. I appreciate any help with this!

2021-03-09 09_41_36-Window.png

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Use the window option of streamstats to limit the range calculation to the current row and the previous row.

| streamstats window=1 range(_time) as Difference by InterchangeID

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Use the window option of streamstats to limit the range calculation to the current row and the previous row.

| streamstats window=1 range(_time) as Difference by InterchangeID

 

---
If this reply helps you, Karma would be appreciated.

Razziq
Explorer

@richgalloway  Thank you! I was able to add window=2 to the search and verified that the timings look accurate after finding the total time and checking against each individual row's timing. For some reason window=1 resulted in all 0 results, but 2 worked as expected. Thanks again!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...