# \[SOLVED\] Measuring duration without using elapsed

**URL:** <https://discuss.elastic.co/t/solved-measuring-duration-without-using-elapsed/67392>\
**Category:** Logstash\
**Created:** [November 28, 2016, 7:38pm UTC](https://discuss.elastic.co/t/solved-measuring-duration-without-using-elapsed/67392 "2016-11-28T19:38:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aeva\_assured](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@aeva\_assured](https://discuss.elastic.co/u/aeva_assured)\
**Post date:** [November 28, 2016, 7:38pm UTC](https://discuss.elastic.co/t/solved-measuring-duration-without-using-elapsed/67392/1 "2016-11-28T19:38:57Z")

</div>

I've been using the elapsed plugin [Github Link](https://github.com/logstash-plugins/logstash-filter-elapsed) to determine the duration of events in my syslog parse and the plugin is not yet compatible with v5.

I've subscribed to the GitHub to see when it gets updated, does anyone have any recommendation on how to measure in the meantime? Right now I'm inserting three tags into my records:  
taskQueued shows when the request is made  
taskStarted shows when the process actually starts  
taskCompleted shows when the event completes

They all have a common variable (eventSeriesId)  
I then use a ruby call to subtract the difference between the queued to complete time and the started to complete time to attach three values:  
Task time  
Queue Time  
Overall Time

Is there another way to accomplish this without elapsed?

Thanks!

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [November 30, 2016, 5:43am UTC](https://discuss.elastic.co/t/solved-measuring-duration-without-using-elapsed/67392/2 "2016-11-30T05:43:41Z")

</div>

Record both timestamp in different fields and use a "scripted" field to calculate the difference

This would give you an example

> <https://stackoverflow.com/questions/32658639/how-to-calculate-difference-between-two-datetime-in-elasticsearch>

---

<div class="post-metadata">

**Author:** ![aeva\_assured](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@aeva\_assured](https://discuss.elastic.co/u/aeva_assured)\
**Post date:** [November 30, 2016, 1:19pm UTC](https://discuss.elastic.co/t/solved-measuring-duration-without-using-elapsed/67392/3 "2016-11-30T13:19:48Z")

</div>

Thank you very much. The elapsed plugin was updated the day after I posted this. I'll close out as solved, but it is good to have another option. Thanks again!

---

<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 28, 2016, 1:19pm UTC](https://discuss.elastic.co/t/solved-measuring-duration-without-using-elapsed/67392/4 "2016-12-28T13:19:56Z")

</div>

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