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

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