Aggregations: Irregular timebased buckets, possible?

(Edward Smit) #1

I would like to accomplish that some time-based events get grouped in buckets of 5m (minutes) each and that the key of the bucket is the minimum value in that bucket. When I use a date_histogram aggregation with an interval of 5m I get buckets that are aligned on 5m periods even when the lowest value in that bucket is larger. So using 5m buckets and the values 21m, 26m, and 44m I would like to have a bucket starting at 21m with two values and one bucket at 44m with one value.
I'm trying to set the min of a date_histogram to the min as found by stats, but I'm unsuccesfull up till know.
Is this even possible, or does anybody know a way to accomplish what I'm trying to do?

(system) #2