# Conversion of field from string to int64

**URL:** <https://discuss.elastic.co/t/conversion-of-field-from-string-to-int64/118611>\
**Category:** Logstash\
**Created:** [February 6, 2018, 10:27am UTC](https://discuss.elastic.co/t/conversion-of-field-from-string-to-int64/118611 "2018-02-06T10:27:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moriol](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@moriol](https://discuss.elastic.co/u/moriol)\
**Post date:** [February 6, 2018, 10:27am UTC](https://discuss.elastic.co/t/conversion-of-field-from-string-to-int64/118611/1 "2018-02-06T10:27:56Z")

</div>

I have some data that is being ingested via Logstash and then being passed to Kafka as an output. From Kafka the data is then being passed to InfluxDB.  
I have a field which is ingested as a string, an example is as this "0.5.-109.116"  
I need this field to be of int64 type instead of a string.  
I see that I cannot convert this as needed via mutate/convert filter or change how it is stored on Kafka output.  
What is the best way to convert this field type in Logstash?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 7, 2018, 7:10am UTC](https://discuss.elastic.co/t/conversion-of-field-from-string-to-int64/118611/2 "2018-02-07T07:10:12Z")

</div>

And what would the desired integer representation of "0.5.-109.116" be?

---

<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:** [March 7, 2018, 7:10am UTC](https://discuss.elastic.co/t/conversion-of-field-from-string-to-int64/118611/3 "2018-03-07T07:10:18Z")

</div>

Closed on March 7, 2018, 7:10am UTC

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