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
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.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.