# Sum calculation on field with Time

**URL:** https://discuss.elastic.co/t/sum-calculation-on-field-with-time/209540
**Category:** Kibana
**Created:** [November 26, 2019, 3:31pm UTC](https://discuss.elastic.co/t/sum-calculation-on-field-with-time/209540 "2019-11-26T15:31:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MrDannyHarry](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@MrDannyHarry](https://discuss.elastic.co/u/MrDannyHarry)
#### Post date: [November 26, 2019, 3:31pm UTC](https://discuss.elastic.co/t/sum-calculation-on-field-with-time/209540/1 "2019-11-26T15:31:45Z")

</div>

Hey All,

Apologies if this is more aimed towards LogStash.  
I have used LogStash to push data to Kibana from a CSV file.

This has so far been successful, my only issue atm is I now want to create a dashboard to view my data, the main data I need to calculate is a Call Duration field. This is in the format HH:MM:SS.

Unfortunately when it pushes this field to Kibana it marks it as a string so I cannot do any calculation on this.

Any help is greatly appreciated.

Cheers,  
Danny

---

<div class="post-metadata">

### Author: ![MrDannyHarry](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@MrDannyHarry](https://discuss.elastic.co/u/MrDannyHarry)
#### Post date: [November 26, 2019, 3:32pm UTC](https://discuss.elastic.co/t/sum-calculation-on-field-with-time/209540/2 "2019-11-26T15:32:58Z")

</div>

This is my LogStash conf file if this is any help.

input {  
file {  
path =\> "cdr.log"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
if [message] =~ /^\s\*$/ { #DELETE BLANK LINE  
drop { }  
}

```
    csv {
            separator => ","
            columns => ["Call Duration","Call Start","Call Answered","Call End","From Name","From Number","To Name","To Number","Final Name","Final Number"]
    }
    mutate {
            gsub => ["From Number", "Ext.", ""]
            gsub => ["To Number", "Ext.", ""]
            gsub => ["Final Number", "Ext.", ""]
            gsub => ["Call Duration", "Call ", ""]
    }

```

}  
output{  
elasticsearch {  
hosts =\> ["IPHERE"]  
index =\> "3cx-stats"  
}  
stdout {}  
}

---

<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: [December 24, 2019, 3:33pm UTC](https://discuss.elastic.co/t/sum-calculation-on-field-with-time/209540/3 "2019-12-24T15:33:13Z")

</div>

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