Histogram bucket first and last record


I am using ES 6.6.0

I have time series cumulative data, i want to do histogram on the data with time being the field and get first and last records in each bucket. How can we do this?

One crude way am thinking is, apply min and max on timestamp, so that i get first and last records, but how do I extract other fields inside these two records?

take a look at the top hits aggregation

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.