Splunk Search

Streamstats delta between values on grouped data incorrect

peiffer
Path Finder

I have data that is extracted from log events by multiple neighbor pairs. I would like to extract deltas on an integer field tableversion, but only among the same neighbor pair Streamstats was suggested for deltas with a ‘by’ clause. In my example below, the first line delta is empty as expected, and the 2nd line delta is correct. All deltas in later lines are incorrect. How do I make streamstats only look at the previous entry?

index=network_internal source="bgp.log" "BGP Queue" 
| eval neighborpair=host + ":" + neighbor
| sort neighborpair,timestamp
| streamstats window=2 global=f current=f first(tableversion) as tableversion_prev by neighborpair
| eval delta=tableversion-tableversion_prev
| table timestamp neighborpair neighborstate nsrstate tableversion delta inq outq prefixes

alt text

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Either set current=t or window=1.

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Either set current=t or window=1.

0 Karma

peiffer
Path Finder

Setting window=1 didn't work for me, but current=t did.

Thanks much

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 ...