# Calculate duration between min and max @timestamp

**URL:** https://discuss.elastic.co/t/calculate-duration-between-min-and-max-timestamp/95754
**Category:** Kibana
**Created:** [August 3, 2017, 5:49pm UTC](https://discuss.elastic.co/t/calculate-duration-between-min-and-max-timestamp/95754 "2017-08-03T17:49:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lefagr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lefagr/32/18830_2.png) [@lefagr](https://discuss.elastic.co/u/lefagr)
#### Post date: [August 3, 2017, 5:49pm UTC](https://discuss.elastic.co/t/calculate-duration-between-min-and-max-timestamp/95754/1 "2017-08-03T17:49:02Z")

</div>

Hello,

We currently using Elastic stack 5.5.1. We are building a security dashboard and we would like to have a visualisation which can calculate the difference between MIN metric: @timestamp and MAX metric: @timestamp  
so we can have the duration of a potential attack.

As it shows in the screenshot I have already min @timestamp marked as start of an attack, max of @timestamp marked as end of the attack, now I'd like to somehow be able to find how long the attack last (min-max) and have it in a dashboard.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d0fdd2694ccd3a185937696a61a40eaea62caf7.png)

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [August 3, 2017, 6:49pm UTC](https://discuss.elastic.co/t/calculate-duration-between-min-and-max-timestamp/95754/2 "2017-08-03T18:49:02Z")

</div>

@lefagr this isn't currently possible, the following [issue](https://github.com/elastic/kibana/issues/2805) discusses some other user's needs as well, please feel free to comment with your use-case.

---

<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: [August 31, 2017, 6:49pm UTC](https://discuss.elastic.co/t/calculate-duration-between-min-and-max-timestamp/95754/3 "2017-08-31T18:49:11Z")

</div>

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