Mutate decimal to long with implied decimal places


Is there a way in logstash to mutate an input field which is a string representation of a decimal (eg. "2387.74") to a long representation of the number with implied decimal places? Ie. We'd like to store that string in elasticsearch as 238774.

We want to do this so we can perform aggregations on them without the rounding errors we'd incur from using doubles.

Thank you

You can use the mutate filter's gsub option to strip any decimals after the two first and remove the decimal point. Then use another mutate filter to convert the field to an integer. Or, use a ruby filter that does event['name-of-field'] = (event['name-of-field'].to_f * 100).to_i.