Splunk Search

How to group by and find stats on every X number of events instead of time or bins?

jwf
New Member

Hello.

I want to get a statistic for values of every X number of non-overlapping events. For example, for events with time and value fields, the average of the values for every 2 fields is

(1-1)
(2-1) --> (1+1)/2=1

(3-2)
(4-3) --> (2+3)/2=2.5
(5-1)
(6-4) --> (1+4)/2=2.5
(7-5)
(8-5) --> (5+5)/2=5
(9-7)

To end up with a chart (time-avg)
(2-->1)
(4-->2.5)
(6-->2.5)
(8-->5)

I looked at bucket (bins, minspan), timechart, streamstats. but couldn't figure it out. Thanks for your help.

0 Karma

gfuente
Motivator

Hello Try this:

| bucket _raw span=2

Regards

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...