# Logstash--Using ruby to convert json to fields. Data going to elastic as text. How to set to long?

**URL:** https://discuss.elastic.co/t/logstash-using-ruby-to-convert-json-to-fields-data-going-to-elastic-as-text-how-to-set-to-long/364075
**Category:** Logstash
**Created:** [July 30, 2024, 4:23pm UTC](https://discuss.elastic.co/t/logstash-using-ruby-to-convert-json-to-fields-data-going-to-elastic-as-text-how-to-set-to-long/364075 "2024-07-30T16:23:21Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 30, 2024, 4:46pm UTC](https://discuss.elastic.co/t/logstash-using-ruby-to-convert-json-to-fields-data-going-to-elastic-as-text-how-to-set-to-long/364075/2 "2024-07-30T16:46:47Z")

</div>

Same answer as you got for [All fields from logstash coming in as text to ES, Pls let me know how to set as keyword? - #2 by Christian\_Dahlqvist](https://discuss.elastic.co/t/all-fields-from-logstash-coming-in-as-text-to-es-pls-let-me-know-how-to-set-as-keyword/364076/2)

---

_[View the full topic](https://discuss.elastic.co/t/logstash-using-ruby-to-convert-json-to-fields-data-going-to-elastic-as-text-how-to-set-to-long/364075)._
