Other Usage

Error in 'streamstats' command: The argument 'diff(count)' is invalid.

POR160893
Builder

I am running the following query:

index="ABCi" sourcetype=DEF
| timechart span=1h count
| fields - _time
| streamstats current=t diff(count) as count_diff
| stats avg(count_diff)


BUT, I am receiving the following error:

Error in 'streamstats' command: The argument 'diff(count)' is invalid.

Can you please help?

Thanks


Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

diff() isn't a stats aggregation function - you could use range() instead, and perhaps a window size of 2

| streamstats current=t window=2 diff(count) as count_diff

 

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