# Does rollup support scripted fields?

**URL:** <https://discuss.elastic.co/t/does-rollup-support-scripted-fields/290503>\
**Category:** Kibana\
**Tags:** painless, rollups\
**Created:** [November 30, 2021, 2:59am UTC](https://discuss.elastic.co/t/does-rollup-support-scripted-fields/290503 "2021-11-30T02:59:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liangliang\_Qiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liangliang_qiu/32/78183_2.png) [@Liangliang\_Qiu](https://discuss.elastic.co/u/Liangliang_Qiu)\
**Post date:** [November 30, 2021, 2:59am UTC](https://discuss.elastic.co/t/does-rollup-support-scripted-fields/290503/1 "2021-11-30T02:59:12Z")

</div>

hi, team, i had created the scripted fields in index patterns. When i create rollups job, i cann't find the scripted fields that i will aggregate on metrics.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a4ca63fa2b0fd5fecb59e46baf7f0ef3944050c8.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/0/c0ff789c500a713ad4abef3033d0ea29fe75c620.png)

---

<div class="post-metadata">

**Author:** ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)\
**Post date:** [November 30, 2021, 8:45pm UTC](https://discuss.elastic.co/t/does-rollup-support-scripted-fields/290503/2 "2021-11-30T20:45:19Z")

</div>

Hi @Liangliang_Qiu, I don't know what version of the stack you're using so I'm responding as though it's 7.15.

_Scripted fields_ compute data on the fly from the data in your Elasticsearch indices and, while using them is supported in Discover, scripted fields aren't part of your index. As such, we can't use them in Rollups.

You'll need to index the data in a way that you have your final scripted output as a field.

Rollups is still an [experimental feature](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/xpack-rollup.html#xpack-rollup) and has a number of limitations for now. You could open an issue for the feature request or, even better, submit a pull request 🙂

---

<div class="post-metadata">

**Author:** ![Liangliang\_Qiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liangliang_qiu/32/78183_2.png) [@Liangliang\_Qiu](https://discuss.elastic.co/u/Liangliang_Qiu)\
**Post date:** [December 2, 2021, 1:11am UTC](https://discuss.elastic.co/t/does-rollup-support-scripted-fields/290503/3 "2021-12-02T01:11:14Z")

</div>

The version of kibana i'm using is 7.9.2.  
So it means that Rollups is based on Elasticsearch indices, not index patterns?

---

<div class="post-metadata">

**Author:** ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)\
**Post date:** [December 2, 2021, 8:16pm UTC](https://discuss.elastic.co/t/does-rollup-support-scripted-fields/290503/4 "2021-12-02T20:16:53Z")

</div>

Indirectly, yes and no.  
If you're configuring the Rollups [in Kibana](https://www.elastic.co/guide/en/kibana/7.9/data-rollups.html), then you'll use the Kibana index patterns.  
These index patterns are _representations_ of the data in your Elasticsearch index that's backing the index pattern.  
In the Kibana UI for creating rollups, you can only use fields that are directly in the index pattern. These don't necessarily have a 1-to-1 mapping with the backing Elasticsearch index but in general, should.

---

<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:** [December 30, 2021, 8:17pm UTC](https://discuss.elastic.co/t/does-rollup-support-scripted-fields/290503/5 "2021-12-30T20:17:23Z")

</div>

Closed on December 30, 2021, 8:17pm UTC

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