How to calculate random no

hello..

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())'
}

Thanks

I solved my problem...

Here is solution so anybody can use this...

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

}

}

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