# Datehistogram + statistical facet: variable time series intervals & aggregates in ES

**URL:** <https://discuss.elastic.co/t/datehistogram-statistical-facet-variable-time-series-intervals-aggregates-in-es/14779>\
**Category:** Elasticsearch\
**Created:** [December 9, 2013, 9:38pm UTC](https://discuss.elastic.co/t/datehistogram-statistical-facet-variable-time-series-intervals-aggregates-in-es/14779 "2013-12-09T21:38:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [December 9, 2013, 9:38pm UTC](https://discuss.elastic.co/t/datehistogram-statistical-facet-variable-time-series-intervals-aggregates-in-es/14779/1 "2013-12-09T21:38:12Z")

</div>

I have a stream of timeseries data that streams to ES once / device /  
second. I would like to apply a facet (or aggregate) that buckets based on  
time but produces the outputs of the stats facet on a value during that  
time.

So something like 5 minute buckets from start\_date to end\_date  
giving count, total, sum of squares, mean (average), minimum, maximum,  
variance, and standard deviation values for those buckets.

Can this be done in the 0.9.x branch? If so, guidance on how and tradeoffs  
will be helpful. How about 1.x and the new aggregates? Client is not going  
live for a few months so the 1.x branch could be reasonable.

Thanks,

--Mike

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAP8axnDbqOfaexQDEDSe-R%3DQ\_Kx-ccsvqcaE7Y13NVnuDxJ3QQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAP8axnDbqOfaexQDEDSe-R%3DQ_Kx-ccsvqcaE7Y13NVnuDxJ3QQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Steve\_Mayzak](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Steve\_Mayzak](https://discuss.elastic.co/u/Steve_Mayzak)\
**Post date:** [December 11, 2013, 2:07am UTC](https://discuss.elastic.co/t/datehistogram-statistical-facet-variable-time-series-intervals-aggregates-in-es/14779/2 "2013-12-11T02:07:23Z")

</div>

Michael,

Thats exactly what the new Aggregations feature is for. Have you seen our  
recent blog post for the 1.0 beta 2 release? Aggregations is included in  
that release.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

I would download the beta and try your example there and let us know how it  
goes.

Here are the aggregations docs:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Monday, December 9, 2013 1:38:12 PM UTC-8, Michael Sick wrote:

> I have a stream of timeseries data that streams to ES once / device /  
> second. I would like to apply a facet (or aggregate) that buckets based on  
> time but produces the outputs of the stats facet on a value during that  
> time.
> 
> So something like 5 minute buckets from start\_date to end\_date  
> giving count, total, sum of squares, mean (average), minimum, maximum,  
> variance, and standard deviation values for those buckets.
> 
> Can this be done in the 0.9.x branch? If so, guidance on how and tradeoffs  
> will be helpful. How about 1.x and the new aggregates? Client is not going  
> live for a few months so the 1.x branch could be reasonable.
> 
> Thanks,
> 
> --Mike

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/65fa4aa3-9579-4f83-b5fd-01a94b06cf5e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/65fa4aa3-9579-4f83-b5fd-01a94b06cf5e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:02am UTC](https://discuss.elastic.co/t/datehistogram-statistical-facet-variable-time-series-intervals-aggregates-in-es/14779/3 "2017-07-06T02:02:04Z")

</div>


