# Time difference between two logs by same id

**URL:** <https://discuss.elastic.co/t/time-difference-between-two-logs-by-same-id/151427>\
**Category:** Elasticsearch\
**Created:** [October 8, 2018, 10:01am UTC](https://discuss.elastic.co/t/time-difference-between-two-logs-by-same-id/151427 "2018-10-08T10:01:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shwesinhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shwesinhan/32/78663_2.png) [@shwesinhan](https://discuss.elastic.co/u/shwesinhan)\
**Post date:** [October 8, 2018, 10:01am UTC](https://discuss.elastic.co/t/time-difference-between-two-logs-by-same-id/151427/1 "2018-10-08T10:01:02Z")

</div>

hi elk team

is that possible to subtract two dates by id in painless script?

eg:

 ![Discover%20%20%20Kibana](https://us1.discourse-cdn.com/elastic/original/3X/9/c/9c6f879eb453784b9c760920fdc8bb368b0e65bf.png)

if possible, plz kindly share me sample. many thanks!

---

<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:** [November 5, 2018, 10:01am UTC](https://discuss.elastic.co/t/time-difference-between-two-logs-by-same-id/151427/2 "2018-11-05T10:01:06Z")

</div>

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