# Kibana graphing average of nested data

**URL:** <https://discuss.elastic.co/t/kibana-graphing-average-of-nested-data/115944>\
**Category:** Elasticsearch\
**Created:** [January 17, 2018, 8:37pm UTC](https://discuss.elastic.co/t/kibana-graphing-average-of-nested-data/115944 "2018-01-17T20:37:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Tomasheski](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@David\_Tomasheski](https://discuss.elastic.co/u/David_Tomasheski)\
**Post date:** [January 17, 2018, 8:37pm UTC](https://discuss.elastic.co/t/kibana-graphing-average-of-nested-data/115944/1 "2018-01-17T20:37:01Z")

</div>

So i have timestamped data coming in with some nested data attached to it. which looks like this:

sessionID: 1  
timestamp 01/17/2018 12:00:00  
tests(nested data type):  
{  
testid: 1  
result: 75  
}  
{  
testId: 2  
result: 88  
}

What i need is a graph of the average of result. Is this possible.

---

<div class="post-metadata">

**Author:** ![David\_Tomasheski](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@David\_Tomasheski](https://discuss.elastic.co/u/David_Tomasheski)\
**Post date:** [January 18, 2018, 4:52pm UTC](https://discuss.elastic.co/t/kibana-graphing-average-of-nested-data/115944/2 "2018-01-18T16:52:09Z")

</div>

I thought about creating sepeate indexes for my data though there is some other data that i didn't show something like:

> SesionINDEX:  
> SessionID: 1  
> Timestamp: 01/17/2018 12:00:100:  
> system: system1

> TESTINDEX having one doc per sesssion:  
> SessionId:1  
> TestId: 1  
> result: 75

I was hoping to then do a visualization based on the timestamp in SESSIONINDEX and tying the sessionIds together to graph avg result

My other thought was to have one index listing per session and just listing all the data for the session each doc. This would solve my issue of getting the avg of result. but then would screw up things like count of sessions per system. Though it may make it easier to get things like avg result based on system.

---

<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:** [February 15, 2018, 4:52pm UTC](https://discuss.elastic.co/t/kibana-graphing-average-of-nested-data/115944/3 "2018-02-15T16:52:17Z")

</div>

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