# Pipelines get event.duration from event.start and event.end

**URL:** <https://discuss.elastic.co/t/pipelines-get-event-duration-from-event-start-and-event-end/268561>\
**Category:** Elasticsearch\
**Created:** [March 27, 2021, 4:50pm UTC](https://discuss.elastic.co/t/pipelines-get-event-duration-from-event-start-and-event-end/268561 "2021-03-27T16:50:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oliver2/32/76684_2.png) [@Oliver2](https://discuss.elastic.co/u/Oliver2)\
**Post date:** [March 27, 2021, 4:50pm UTC](https://discuss.elastic.co/t/pipelines-get-event-duration-from-event-start-and-event-end/268561/1 "2021-03-27T16:50:34Z")

</div>

what can i do in an elastic search pipeline to workout the event.duration from event.start and event.end

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 27, 2021, 5:45pm UTC](https://discuss.elastic.co/t/pipelines-get-event-duration-from-event-start-and-event-end/268561/2 "2021-03-27T17:45:48Z")

</div>

A script processor should help to compute that value.

---

<div class="post-metadata">

**Author:** ![Oliver2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oliver2/32/76684_2.png) [@Oliver2](https://discuss.elastic.co/u/Oliver2)\
**Post date:** [March 27, 2021, 6:41pm UTC](https://discuss.elastic.co/t/pipelines-get-event-duration-from-event-start-and-event-end/268561/3 "2021-03-27T18:41:33Z")

</div>

I thought as much but im not really sure how I should do it any ideas? not very familiar with painless/scripting both fields I either epoc or converted using the date

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 28, 2021, 2:23pm UTC](https://discuss.elastic.co/t/pipelines-get-event-duration-from-event-start-and-event-end/268561/4 "2021-03-28T14:23:10Z")

</div>

Not familiar too but you can probably start with:

> **[Script processor | Elasticsearch Reference \[7.12\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/script-processor.html)**

---

<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:** [April 25, 2021, 2:23pm UTC](https://discuss.elastic.co/t/pipelines-get-event-duration-from-event-start-and-event-end/268561/5 "2021-04-25T14:23:29Z")

</div>

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