# Splitting event duration for every hour using start and end date

**URL:** <https://discuss.elastic.co/t/splitting-event-duration-for-every-hour-using-start-and-end-date/157113>\
**Category:** Elasticsearch\
**Created:** [November 16, 2018, 5:27pm UTC](https://discuss.elastic.co/t/splitting-event-duration-for-every-hour-using-start-and-end-date/157113 "2018-11-16T17:27:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samar](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Samar](https://discuss.elastic.co/u/Samar)\
**Post date:** [November 16, 2018, 5:27pm UTC](https://discuss.elastic.co/t/splitting-event-duration-for-every-hour-using-start-and-end-date/157113/1 "2018-11-16T17:27:30Z")

</div>

I'd like to plot the duration of activity of an event in a date histogram hourly .  
For every event i have the start time, the end time and the duration ,  
for example having this log event: "startDate=2018.11.09 08:30:00+0000,endDate=2018.11.09 10:30:02+0000,duration=PT2H2S" .  
I'd know that is active in the hour8 for 30minute and in the hour9 for 1 hour and in the hour10 for 30minute and 2 second.

---

<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 14, 2018, 5:27pm UTC](https://discuss.elastic.co/t/splitting-event-duration-for-every-hour-using-start-and-end-date/157113/2 "2018-12-14T17:27:32Z")

</div>

Closed on December 14, 2018, 5:27pm UTC

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