Hello,
I read the documentation about the ruby script and I did not correctly understand the conversion of the ruby script into a file.
If I have a converted ruby script into a file, do I have to rewrite the script into classes?
For example, I wanted to put this ruby script in a file, but it didn't work there at all. When I have this in filter section, it works:
ruby { code => " event.set('[event][duration_seconds]', event.get('[event][duration]').to_f / 1000) "}
I put it into the file. In the filter was:
ruby {
path => "{{logstash.scripts_path}}/count.rb"
}
The content of the file was:
event.set('[event][duration_seconds]', event.get('[event][duration]').to_f / 1000)
Why it didn´t work?
Thank you
Regards,
Catherine