# Calculate delta time between the log and pervious one

**URL:** <https://discuss.elastic.co/t/calculate-delta-time-between-the-log-and-pervious-one/161713>\
**Category:** Kibana\
**Created:** [December 20, 2018, 3:05pm UTC](https://discuss.elastic.co/t/calculate-delta-time-between-the-log-and-pervious-one/161713 "2018-12-20T15:05:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![et159](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@et159](https://discuss.elastic.co/u/et159)\
**Post date:** [December 20, 2018, 3:05pm UTC](https://discuss.elastic.co/t/calculate-delta-time-between-the-log-and-pervious-one/161713/1 "2018-12-20T15:05:36Z")

</div>

Hello ,  
I have 30 logs and they are repeated every three minutes, I need to calculate the time difference between each two logs and keep this values tracked,

```
12/20/2018 Time: 09:40:01.123456 Operation1
12/20/2018 Time: 09:40:01.123007 Operation2
12/20/2018 Time: 09:40:01.123100 Operation3
12/20/2018 Time: 09:40:04.123256 Operation30

```

I will insert need to calculate the time between log 2-1 , 3-2 ...etc  
I had a look to elapse plugin but it's not fit my application here ,  
any thoughts ...

Thanks in advance .

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [December 20, 2018, 4:29pm UTC](https://discuss.elastic.co/t/calculate-delta-time-between-the-log-and-pervious-one/161713/2 "2018-12-20T16:29:58Z")

</div>

Unfortunately this isn't something Kibana will be super helpful with. It would be much better if you could calculate this when indexing into Elasticsearch and have it be a field on the document itself (i.e. `elapsedTimeSinceLastLog` or something).

---

<div class="post-metadata">

**Author:** ![et159](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@et159](https://discuss.elastic.co/u/et159)\
**Post date:** [December 20, 2018, 5:57pm UTC](https://discuss.elastic.co/t/calculate-delta-time-between-the-log-and-pervious-one/161713/3 "2018-12-20T17:57:06Z")

</div>

Thanks a lot for your reply,  
I will try to implement that,

---

<div class="post-metadata">

**Author:** ![et159](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@et159](https://discuss.elastic.co/u/et159)\
**Post date:** [January 7, 2019, 7:12pm UTC](https://discuss.elastic.co/t/calculate-delta-time-between-the-log-and-pervious-one/161713/4 "2019-01-07T19:12:58Z")

</div>

> [@lukas](#):
>
> elapsedTimeSinceLastLog

any hints about how the configuration will be ?  
I tried to use elapsed plugin during the ingestion, but I faced some difficulties with the grok filter, because I already had filter .

---

<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:** [February 4, 2019, 7:20pm UTC](https://discuss.elastic.co/t/calculate-delta-time-between-the-log-and-pervious-one/161713/5 "2019-02-04T19:20:07Z")

</div>

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