# How do i convert time based events into duration on a chart

**URL:** https://discuss.elastic.co/t/how-do-i-convert-time-based-events-into-duration-on-a-chart/35294
**Category:** Kibana
**Created:** [November 23, 2015, 10:28am UTC](https://discuss.elastic.co/t/how-do-i-convert-time-based-events-into-duration-on-a-chart/35294 "2015-11-23T10:28:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mohammed\_Abdul\_Khali](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Mohammed\_Abdul\_Khali](https://discuss.elastic.co/u/Mohammed_Abdul_Khali)
#### Post date: [November 23, 2015, 10:28am UTC](https://discuss.elastic.co/t/how-do-i-convert-time-based-events-into-duration-on-a-chart/35294/1 "2015-11-23T10:28:09Z")

</div>

Hi,

My data in ES has timestamps varying in seconds and minutes.  
Say if i have 10 records with timestamps, with the duration as 10 minutes.  
How could i show it in kibana on X axis as 0 to 10 minutes and the data which falls in this interval rather than showing the entire timestamp or time?

Kindly advice.

---

<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: [November 24, 2015, 3:54am UTC](https://discuss.elastic.co/t/how-do-i-convert-time-based-events-into-duration-on-a-chart/35294/2 "2015-11-24T03:54:46Z")

</div>

Is duration a specific field?  
If so you can do a range agg.

---

<div class="post-metadata">

### Author: ![Mohammed\_Abdul\_Khali](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Mohammed\_Abdul\_Khali](https://discuss.elastic.co/u/Mohammed_Abdul_Khali)
#### Post date: [November 24, 2015, 8:55am UTC](https://discuss.elastic.co/t/how-do-i-convert-time-based-events-into-duration-on-a-chart/35294/3 "2015-11-24T08:55:38Z")

</div>

Hi Mark,

Duration is not a field. I meant that say i have 5 records with timestamps as

November 24, 2015 12:00:00.000  
November 24, 2015 12:05:00.000  
November 24, 2015 12:10:00.000  
November 24, 2015 12:15:00.000  
November 24, 2015 12:20:00.000

So now on X axis i need the duration to be calculated and shown as 0, 5, 10, 15, and 20. I hope i tried to keep my point clear.

Is this possible?

Thank you.

---

<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: [July 6, 2017, 2:08pm UTC](https://discuss.elastic.co/t/how-do-i-convert-time-based-events-into-duration-on-a-chart/35294/4 "2017-07-06T14:08:24Z")

</div>


