# How to convert String to long in logstash

**URL:** <https://discuss.elastic.co/t/how-to-convert-string-to-long-in-logstash/116029>\
**Category:** Logstash\
**Created:** [January 18, 2018, 11:36am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-long-in-logstash/116029 "2018-01-18T11:36:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RamyaGowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramyagowda/32/27440_2.png) [@RamyaGowda](https://discuss.elastic.co/u/RamyaGowda)\
**Post date:** [January 18, 2018, 11:36am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-long-in-logstash/116029/1 "2018-01-18T11:36:56Z")

</div>

Example from my log i am getting response time as String in ES i want to convert it to long

mutate{  
convert =\> {"respnseTime" =\> "long"}  
}

it throws me an error

---

<div class="post-metadata">

**Author:** ![paz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paz/32/28003_2.png) [@paz](https://discuss.elastic.co/u/paz)\
**Post date:** [January 18, 2018, 12:20pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-long-in-logstash/116029/2 "2018-01-18T12:20:40Z")

</div>

_Long_ is not a valid conversion datatype. See [here](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-convert) for the available options.

---

<div class="post-metadata">

**Author:** ![RamyaGowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramyagowda/32/27440_2.png) [@RamyaGowda](https://discuss.elastic.co/u/RamyaGowda)\
**Post date:** [January 29, 2018, 5:37am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-long-in-logstash/116029/3 "2018-01-29T05:37:53Z")

</div>

Thanks for the reply

---

<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:** [February 26, 2018, 5:38am UTC](https://discuss.elastic.co/t/how-to-convert-string-to-long-in-logstash/116029/4 "2018-02-26T05:38:27Z")

</div>

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