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


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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Request for Professional Development: Attending .conf26

Winning Over the Boss: Your Pass to .conf26 conf26 is going to be here before you know it. If don't already ...