# Average Aggregation not using Index duration property

**URL:** <https://discuss.elastic.co/t/average-aggregation-not-using-index-duration-property/150067>\
**Category:** Kibana\
**Created:** [September 26, 2018, 6:05pm UTC](https://discuss.elastic.co/t/average-aggregation-not-using-index-duration-property/150067 "2018-09-26T18:05:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [September 26, 2018, 6:05pm UTC](https://discuss.elastic.co/t/average-aggregation-not-using-index-duration-property/150067/1 "2018-09-26T18:05:11Z")

</div>

I have an index that has a numeric field representing seconds. That said, the stats I am presenting really needs to be in human readable so I have selected the format in the index pattern to be Duration. So, 180 seconds reads as 3 minutes. Perfect.

However, I am using another visualization to display the average time for a date range but when I do that the displayed average is shown in seconds rather than minutes. So for example the the average duration for the that day would be displayed as 180 (seconds) not 3 minutes.

Is there any way to have the average shown formatted for duration rather than the native seconds.

---

<div class="post-metadata">

**Author:** ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)\
**Post date:** [September 26, 2018, 9:59pm UTC](https://discuss.elastic.co/t/average-aggregation-not-using-index-duration-property/150067/2 "2018-09-26T21:59:09Z")

</div>

Hi, can you share a screenshot of your field formatting and your visualization configuration? I attempted this locally and it works out of the box:

My `bytes` field configured as Human Readable duration:

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

A **Metric** visualization on the same index pattern of average bytes, output is Human Readable:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/8/b86b1ddc3289a5096986d202a64fce1807e7cb52.png)

---

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [September 28, 2018, 7:15pm UTC](https://discuss.elastic.co/t/average-aggregation-not-using-index-duration-property/150067/3 "2018-09-28T19:15:37Z")

</div>

Thanks for the quick response! BTW, I am on Kibana and Elastic 6.2.4.  
Also, I should re-iterate that this only happens when we are averaging and then grouping by weeks.

Here is my index definition:

 ![Capture_mttr_index](https://us1.discourse-cdn.com/elastic/original/3X/b/0/b0f6822be99caae28011f9c545cf3b16fca3b7a3.png)

Here is my visualization for the one that works:  
 ![GIF](https://us1.discourse-cdn.com/elastic/original/3X/0/9/098c3c29cf5f503f2987f7c7660da9b3153cb6f5.png)

Her is my visualization for the one that doesn't! In this case it is showing seconds:

 ![GIF](https://us1.discourse-cdn.com/elastic/original/3X/c/9/c95fed5c36080c8aa62eb3f0a9451cd13d11a26a.png)

What it looks like in the dashboard:  
 ![Capture_dashboard](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4ac8984f52f3d27e217b71f670308d2016280f6e.png)

---

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [October 3, 2018, 4:26pm UTC](https://discuss.elastic.co/t/average-aggregation-not-using-index-duration-property/150067/4 "2018-10-03T16:26:12Z")

</div>

Hi Jen. Did I provide enough information?

---

<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:** [October 31, 2018, 4:26pm UTC](https://discuss.elastic.co/t/average-aggregation-not-using-index-duration-property/150067/5 "2018-10-31T16:26:18Z")

</div>

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