Closed ash0080 closed 5 years ago
How about using record_transformer filter to convert number type?
<filter test.**>
@type record_transformer
enable_ruby true
<record>
foo ${record["foo"].to_f}
</record>
</filter>
Sure, that's what I did. but It's better to run it without any tricky operations. at least fitting the influxdb‘s protocol. so why not transform all number to float?
I am having the same issue as @ash0080 The record transformer solution is nice when you have one field with that problem, but when you have dozens, and when you want to add later another key, you need to edit the fluent conf... It's a good idea to make it float by default
I added a PR for that https://github.com/fangli/fluent-plugin-influxdb/pull/95
You can close the issue since it is fixed, the PR got merged :+1:
Now, insert an integer to a float field will throw an "already exists as type float" error
because there isn't precision float in Javascript, e.x: 1.0, 2.0... 10.0 all will be converted to integer automatically. And as described in the 3032, now all numbers in influxdb are float, so could this be fixed? Or could add an auto parse func from String?