# Downsampling Time Series

**URL:** <https://discuss.elastic.co/t/downsampling-time-series/77551>\
**Category:** Kibana\
**Created:** [March 6, 2017, 5:32pm UTC](https://discuss.elastic.co/t/downsampling-time-series/77551 "2017-03-06T17:32:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nastooh](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@Nastooh](https://discuss.elastic.co/u/Nastooh)\
**Post date:** [March 6, 2017, 5:32pm UTC](https://discuss.elastic.co/t/downsampling-time-series/77551/1 "2017-03-06T17:32:42Z")

</div>

Hi  
Have a visualisation plot, where x axis is the event occurrence time. Currently, I am able to set the time window of interest via number of points in x-axis, e.g., in the case shown below ,1e6 points corresponds to 10 hours.:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d5dd79eed1285ff54e92a6fe76c0fd659b7f03ea.png)

I am wondering if it is possible to define 1:n downsampling ratio for a given range, e.g., drop every 2nd sample, while preserving the same range, thus reducing the number of samples to 5e5.  
Cheers,

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [March 7, 2017, 8:46pm UTC](https://discuss.elastic.co/t/downsampling-time-series/77551/2 "2017-03-07T20:46:32Z")

</div>

Hi @Nastooh,

if you use the date histogram aggregation, you're able to define a custom aggregation interval like so:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/f/df2246d31553ef21b8e7b1226558fc4738955347.png)

You adjust the interval to fit your data.

---

<div class="post-metadata">

**Author:** ![Nastooh](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@Nastooh](https://discuss.elastic.co/u/Nastooh)\
**Post date:** [March 8, 2017, 11:50pm UTC](https://discuss.elastic.co/t/downsampling-time-series/77551/3 "2017-03-08T23:50:27Z")

</div>

That would do thank you.

---

<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:** [April 5, 2017, 11:50pm UTC](https://discuss.elastic.co/t/downsampling-time-series/77551/4 "2017-04-05T23:50:30Z")

</div>

Closed on April 5, 2017, 11:50pm UTC

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