# Sum of Duration

**URL:** <https://discuss.elastic.co/t/sum-of-duration/68840>\
**Category:** Kibana\
**Created:** [December 13, 2016, 9:40am UTC](https://discuss.elastic.co/t/sum-of-duration/68840 "2016-12-13T09:40:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aurevan](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@Aurevan](https://discuss.elastic.co/u/Aurevan)\
**Post date:** [December 13, 2016, 9:40am UTC](https://discuss.elastic.co/t/sum-of-duration/68840/1 "2016-12-13T09:40:27Z")

</div>

Hi,

I have an ELK who collect the logs of a firewall, in this log i have à field duration who is actually a data type, but i would like to make a sum of all this duration by user, i haven't idea of how i can do this trick someone can help me ?

Should i change the type of my duration for time type (HH:MM:SS) ?

Thx in advance

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [December 13, 2016, 2:23pm UTC](https://discuss.elastic.co/t/sum-of-duration/68840/2 "2016-12-13T14:23:09Z")

</div>

I _think_ I understand your setup but, just to be clear, would you mind sharing your index mapping? You can get the mapping for your index by issuing a `GET <index name>` HTTP request to any Elasticsearch node.

Without seeing your mapping, my _guess_ at this point is that you are correct: you will want to change the type of the `duration` field to an integer or long and have it store number of seconds or milliseconds (depending on the precision you desire).

---

<div class="post-metadata">

**Author:** ![Aurevan](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@Aurevan](https://discuss.elastic.co/u/Aurevan)\
**Post date:** [December 14, 2016, 3:55pm UTC](https://discuss.elastic.co/t/sum-of-duration/68840/3 "2016-12-14T15:55:20Z")

</div>

Hi, i've found another solution i've identied two type of request on my cisco asa, the two types mean the start of VPN connection and the end , how can i make a scripted field to return the duration of the connection ? Thx in advance

---

<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:** [January 11, 2017, 3:56pm UTC](https://discuss.elastic.co/t/sum-of-duration/68840/4 "2017-01-11T15:56:29Z")

</div>

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