Logstash JSON代码和Ruby未正确处理十进制(浮点)
我有Kafak Logstash(然后是Ruby)Elastic 卡法克输入:Logstash JSON代码和Ruby未正确处理十进制(浮点),ruby,logstash,elastic-stack,Ruby,Logstash,Elastic Stack,我有Kafak Logstash(然后是Ruby)Elastic 卡法克输入: {"customerid":"smit","last_name":"shah","age":10,"height":10,"weight":100,"automated_email":false, "header": { "end
{"customerid":"smit","last_name":"shah","age":10,"height":10,"weight":100,"automated_email":false, "header": { "endpoint":"/pay"}, "transaction": { "amount":100.50, "currency" : "SGD"}}
日志存储:
json {
source => "message"
}
mutate {
convert => { "amount" => "float" }
}
ruby {
# Cancel 90% of events
path => "/usr/local/etc/logstash/main.rb"
script_params => { "percentage" => 0.9 }
}
}
红宝石
这张照片是:
{"amount"=>0.1005e3, "currency"=>"SGD"}
0.1005e3
为什么我得不到100.5英镑?试着使用
交易['amount']。要想知道不,它仍然是0.1005e3
{"amount"=>0.1005e3, "currency"=>"SGD"}
0.1005e3