# Configuring elastic-search to store certain aggregations and use pre-computed aggregations to respond to queries?

**URL:** <https://discuss.elastic.co/t/configuring-elastic-search-to-store-certain-aggregations-and-use-pre-computed-aggregations-to-respond-to-queries/84058>\
**Category:** Elasticsearch\
**Created:** [April 28, 2017, 8:27pm UTC](https://discuss.elastic.co/t/configuring-elastic-search-to-store-certain-aggregations-and-use-pre-computed-aggregations-to-respond-to-queries/84058 "2017-04-28T20:27:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emily1](https://avatars.discourse-cdn.com/v4/letter/e/76d3ee/32.png) [@Emily1](https://discuss.elastic.co/u/Emily1)\
**Post date:** [April 28, 2017, 8:27pm UTC](https://discuss.elastic.co/t/configuring-elastic-search-to-store-certain-aggregations-and-use-pre-computed-aggregations-to-respond-to-queries/84058/1 "2017-04-28T20:27:52Z")

</div>

Hi,

I have been looking around for a couple weeks for this and I can't figure out how I might do it. I am using Elasticsearch as a TSDB. When I am using Kibana and I want to look at a bunch of data over a period of a day, for example, it seems like Elasticsearch is aggregating it on the fly starting from all the per-second logs. The preferred behavior would be to have some pre-computed hourly or ten-minute aggregations of a certain kind, for example, and have Elasticsearch be smart enough to use those precomputed aggregations when responding to queries for a field. I still want the high-resolution data available for when I want to zoom in on a shorter time period.

Clearly, I could do something like this manually where I periodically run aggregation queries for $FIELD and store the result in something like $FIELD\_hourly or $FIELD\_daily. Is there a way to do this that doesn't require me to have separately-named fields of varying resolutions? The issue is that I would need to have separate visualizations in Kibana that query the correct field name based on the time period the visualization is designed for.

Thank you!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 28, 2017, 8:40pm UTC](https://discuss.elastic.co/t/configuring-elastic-search-to-store-certain-aggregations-and-use-pre-computed-aggregations-to-respond-to-queries/84058/2 "2017-04-28T20:40:24Z")

</div>

> [@Emily1](#):
>
> it seems like Elasticsearch is aggregating it on the fly starting from all the per-second logs

Yes, that is what it does.

> [@Emily1](#):
>
> Is there a way to do this that doesn't require me to have separately-named fields of varying resolutions?

Not at this point.

---

<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:** [May 26, 2017, 8:54pm UTC](https://discuss.elastic.co/t/configuring-elastic-search-to-store-certain-aggregations-and-use-pre-computed-aggregations-to-respond-to-queries/84058/3 "2017-05-26T20:54:28Z")

</div>

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