# Is it possible to convert a string into an int, in Kibana?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-convert-a-string-into-an-int-in-kibana/63645>\
**Category:** Kibana\
**Created:** [October 21, 2016, 6:09pm UTC](https://discuss.elastic.co/t/is-it-possible-to-convert-a-string-into-an-int-in-kibana/63645 "2016-10-21T18:09:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [October 21, 2016, 6:09pm UTC](https://discuss.elastic.co/t/is-it-possible-to-convert-a-string-into-an-int-in-kibana/63645/1 "2016-10-21T18:09:54Z")

</div>

I'm trying to create a `data table` using kibana for a set of data in an index. I'm having a field in my database which is a `String`, and I have to convert it to an `int` so that I could use it for the `sum` aggregation in `Kibana` metrics.

Is there a way that I can directly convert it through `Kibana` or should I go with the `logstash` and do the conversion first?

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [October 21, 2016, 8:24pm UTC](https://discuss.elastic.co/t/is-it-possible-to-convert-a-string-into-an-int-in-kibana/63645/2 "2016-10-21T20:24:54Z")

</div>

There's no way to do that conversion in Kibana 4. In Kibana 5 you'll be able to write a [Painless](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting-painless.html) scripted field that can do the conversion. That said, scripted fields are generally slower than regular fields and have some limitations, so if you can it's best to massage the data with logstash before indexing.

---

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [October 22, 2016, 2:45pm UTC](https://discuss.elastic.co/t/is-it-possible-to-convert-a-string-into-an-int-in-kibana/63645/3 "2016-10-22T14:45:22Z")

</div>

Thank you so much.. 🙂

---

<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:** [July 6, 2017, 1:36pm UTC](https://discuss.elastic.co/t/is-it-possible-to-convert-a-string-into-an-int-in-kibana/63645/4 "2017-07-06T13:36:00Z")

</div>


