# Why elasticsearch/kibana changes format of data?

**URL:** <https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358>\
**Category:** Kibana\
**Created:** [July 24, 2017, 3:56pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358 "2017-07-24T15:56:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eminiar](https://avatars.discourse-cdn.com/v4/letter/e/e274bd/32.png) [@eminiar](https://discuss.elastic.co/u/eminiar)\
**Post date:** [July 24, 2017, 3:56pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358/1 "2017-07-24T15:56:05Z")

</div>

Hello!

I have the following values of build Duration (seconds) in Jenkins.  
Failed #28 0.75 sec master  
Failed #27 0.44 sec master  
Failed #26 0.46 sec master  
Failed #25 0.55 sec master

Logstash plugin's in jenkins sent this values to elasticsearh

Also in kibana I see these values (not in seconds format):

data.buildNum: 28 data.buildDuration: 461  
data.buildNum: 27 data.buildDuration: 392  
data.buildNum: 26 data.buildDuration: 398  
data.buildNum: 25 data.buildDuration: 513

Anyone know why these values change it?. Or How to format the value in kibana?

Regards,

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [July 24, 2017, 6:11pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358/2 "2017-07-24T18:11:02Z")

</div>

Kibana should simply be showing the values of `data.buildDuration` as they exist in Elasticsearch. It's probably an issue with the Logstash config. If you query Elasticsearch directly for the values, do you see something else?

---

<div class="post-metadata">

**Author:** ![eminiar](https://avatars.discourse-cdn.com/v4/letter/e/e274bd/32.png) [@eminiar](https://discuss.elastic.co/u/eminiar)\
**Post date:** [July 24, 2017, 6:28pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358/3 "2017-07-24T18:28:25Z")

</div>

this is the result of query to elasticsearch

"buildHost":"Jenkins","buildLabel":"master","buildNum":28,"buildDuration":461,

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [July 24, 2017, 8:00pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358/4 "2017-07-24T20:00:50Z")

</div>

Alright, so the value in Elasticsearch is 461, and that's what you see in Kibana. This is what I was expecting to see. Something is not working the way you expect at the indexing stage. The value in Elasticsearch and the value in Kibana are the same, but it's not what you expected.

Maybe what the Logstash plugin is actually setting is the millisecond value? It doesn't seem to line up quite that way though. Maybe the value it records isn't supposed to correspond directly to the "sec" value you see in the build duration output?

---

<div class="post-metadata">

**Author:** ![eminiar](https://avatars.discourse-cdn.com/v4/letter/e/e274bd/32.png) [@eminiar](https://discuss.elastic.co/u/eminiar)\
**Post date:** [July 24, 2017, 8:31pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358/5 "2017-07-24T20:31:15Z")

</div>

I check it the code of logstash plugin

> <https://github.com/jenkinsci/logstash-plugin/blob/master/src/main/java/jenkins/plugins/logstash/persistence/BuildData.java>

"protected long buildDuration;"  
"buildDuration = currentTime.getTime() - build.getStartTimeInMillis();"

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [July 24, 2017, 10:04pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358/6 "2017-07-24T22:04:01Z")

</div>

Based on those variable names, it sounds like the `buildDuration` is in fact in milliseconds then. You can either convert it to another format, like seconds, at index time if you'd like, or you can use the duration field formatter in Kibana to make it show as seconds on the fly.

---

<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 21, 2017, 10:04pm UTC](https://discuss.elastic.co/t/why-elasticsearch-kibana-changes-format-of-data/94358/7 "2017-08-21T22:04:11Z")

</div>

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