# Aggregrating data from Nested Fields

**URL:** <https://discuss.elastic.co/t/aggregrating-data-from-nested-fields/341845>\
**Category:** Kibana\
**Tags:** vega, visualisation\
**Created:** [August 29, 2023, 2:13am UTC](https://discuss.elastic.co/t/aggregrating-data-from-nested-fields/341845 "2023-08-29T02:13:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kumar\_Abhinav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar_abhinav/32/122208_2.png) [@Kumar\_Abhinav](https://discuss.elastic.co/u/Kumar_Abhinav)\
**Post date:** [August 29, 2023, 2:13am UTC](https://discuss.elastic.co/t/aggregrating-data-from-nested-fields/341845/1 "2023-08-29T02:13:40Z")

</div>

I am currently navigating Elasticsearch and Kibana version 8.7.1 and have encountered a challenge

**The Challenge: Aggregating Nested Fields**

My primary goal is to efficiently aggregate data residing within nested fields in my Elasticsearch index. While using Kibana's built-in filtering options, I've noticed discrepancies in the results, which has raised some questions about data accuracy.

**Questions That Pique My Curiosity:**

1. **Aggregating Nested Fields:** How can I accurately aggregate data from nested fields within Kibana 8.7.1? The standard filtering mechanisms don't seem to yield the precise numbers I require. I'm eager to learn more about the best practices and strategies for tackling this.

2. **Scripted Fields in Kibana 8.7.1:** Additionally, I am keen to explore the world of scripted fields within Kibana 8.7.1. I believe that harnessing scripted fields might be the key to obtaining the insights I seek. If anyone has insights into how to craft and leverage scripted fields effectively, I'd love to hear from you.

I welcome any tips, examples, or guidance you're willing to share.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [August 29, 2023, 8:15am UTC](https://discuss.elastic.co/t/aggregrating-data-from-nested-fields/341845/2 "2023-08-29T08:15:37Z")

</div>

> How can I accurately aggregate data from nested fields within Kibana 8.7.1?

To visualize them directly the only option available so far is Vega, as they are not supported in Visualizations: [Nested field support in Visualize · Issue #58175 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/58175)

> **Scripted Fields in Kibana 8.7.1**

While it works as a workaround to get access to a nested field content via scripted fields, it is worth mentioning that scripted field are a deprecated feature.  
There's some investigation for runtime field support as well (which are the successor of scripted fields) you can track here: [Nested field support · Issue #1084 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/1084#issuecomment-1116735966)

---

<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:** [September 26, 2023, 8:16am UTC](https://discuss.elastic.co/t/aggregrating-data-from-nested-fields/341845/3 "2023-09-26T08:16:08Z")

</div>

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