# How to sum time ranges in kibana

**URL:** https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838
**Category:** Kibana
**Created:** [December 7, 2018, 3:40am UTC](https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838 "2018-12-07T03:40:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![suripaleru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suripaleru/32/32286_2.png) [@suripaleru](https://discuss.elastic.co/u/suripaleru)
#### Post date: [December 7, 2018, 3:40am UTC](https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838/1 "2018-12-07T03:40:04Z")

</div>

I have a filed in logs which shows execution time in time format like hh:mm:as

In kibana, I would like to sum all of these and show under metric.

Log value is coming in DateTime format. Please help for the solution.

---

<div class="post-metadata">

### Author: ![bryan\_stuhlsatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_stuhlsatz/32/49123_2.png) [@bryan\_stuhlsatz](https://discuss.elastic.co/u/bryan_stuhlsatz)
#### Post date: [December 7, 2018, 5:13am UTC](https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838/2 "2018-12-07T05:13:24Z")

</div>

In the "metrics" aggregation of your visualization, choose sum. Then pick the field that you want to sum.

---

<div class="post-metadata">

### Author: ![suripaleru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suripaleru/32/32286_2.png) [@suripaleru](https://discuss.elastic.co/u/suripaleru)
#### Post date: [December 7, 2018, 5:30am UTC](https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838/3 "2018-12-07T05:30:25Z")

</div>

But under SUM, date fields are not coming. I need to Sum Bucket and choose date field. In this case, kibana is only doing sum for hours but not for minutes and seconds.

---

<div class="post-metadata">

### Author: ![suripaleru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suripaleru/32/32286_2.png) [@suripaleru](https://discuss.elastic.co/u/suripaleru)
#### Post date: [December 21, 2018, 9:37am UTC](https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838/4 "2018-12-21T09:37:14Z")

</div>

Hi, any solution please ?

---

<div class="post-metadata">

### Author: ![bryan\_stuhlsatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_stuhlsatz/32/49123_2.png) [@bryan\_stuhlsatz](https://discuss.elastic.co/u/bryan_stuhlsatz)
#### Post date: [December 24, 2018, 1:12am UTC](https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838/5 "2018-12-24T01:12:41Z")

</div>

I am assuming that you are wanting to add up the time to show how long something took to execute. You will need to have a field that converts the time to an integer. That integer needs to represent something like seconds, minutes, etc. Then in kibana, you can define that field as a duration field, and define what the input and output formats will be: milliseconds, seconds, minutes, etc). I believe there are some enhancement requests in so that the output format could look like a "time" format, like HH:mm:ss.

---

<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 21, 2019, 1:12am UTC](https://discuss.elastic.co/t/how-to-sum-time-ranges-in-kibana/159838/6 "2019-01-21T01:12:52Z")

</div>

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