How to calculate random no



Anybody know how to generate random numbers between 0 to .5 using logstash.
I use the following code but not working..

ruby {
code => 'event.set("randomNumber", rand(100).to_i())'



I solved my problem...

Here is solution so anybody can use this...

ruby {
code => 'event.set("randomNumber", ((rand() *0.9).to_f))'



(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.