# Time-difference between multiple occurrences of a custom pattern

**URL:** <https://discuss.elastic.co/t/time-difference-between-multiple-occurrences-of-a-custom-pattern/77642>\
**Category:** Logstash\
**Created:** [March 7, 2017, 11:14am UTC](https://discuss.elastic.co/t/time-difference-between-multiple-occurrences-of-a-custom-pattern/77642 "2017-03-07T11:14:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruthu\_Ramya](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@Ruthu\_Ramya](https://discuss.elastic.co/u/Ruthu_Ramya)\
**Post date:** [March 7, 2017, 11:14am UTC](https://discuss.elastic.co/t/time-difference-between-multiple-occurrences-of-a-custom-pattern/77642/1 "2017-03-07T11:14:44Z")

</div>

Hi,

I have the interesting log-lines as shown below:

> Nov 30,14:49:56.785 INFO Plane 1A landed  
> Nov 30,14:49:57.099 INFO Plane 2B landed  
> Nov 30,14:49:57.368 INFO Plane 2C landed  
> Nov 30,14:49:57.620 INFO Plane 2D landed  
> Nov 30,14:49:57.900 INFO Plane 5X landed  
> Nov 30,14:49:58.267 INFO Plane 6G landed

I need the difference between the 4th(i+3) occurrence and current occurrence for particular calculation.  
Ex:

> diff14 = Nov 30,14:49:57.620 - Nov 30,14:49:56.785  
> diff25 = Nov 30,14:49:57.900 - Nov 30,14:49:57.099  
> diff36 = Nov 30,14:49:58.267 - Nov 30,14:49:57.368

Any help please? Thanks.

Regards,  
Ruthu

---

<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 4, 2017, 11:14am UTC](https://discuss.elastic.co/t/time-difference-between-multiple-occurrences-of-a-custom-pattern/77642/2 "2017-04-04T11:14:46Z")

</div>

Closed on April 4, 2017, 11:14am UTC

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