Ruby Filter change in 5

Hi, I have been using a Ruby filter for some of by information, however since I have upgraded to 5 these no longer work. I have tried to understand exactly what changes under however without success. Could I kindly get assistance with the change of the filter to be compatible again with Logstash 5?

Here are my two filters I use:
ruby{ code=>"event['Duration_m'] = (event['Duration_s'] / 60.00).round(2)" }

ruby{ code=>"event['vol_KB'] = (event['vol_bytes'] / 1000)" }


the bottom of the page you list ([Breaking changes] summarizes what you are facing... see the bottom of the link, under:
'Ruby Filter and Custom Plugin Developers'. It's a nice summary of what changed in ruby filter and how you need to modify your code.

The link Magnus lists goes into the change in more detail.

Thank you very much @magnusbaeck and @fh8510, I will go through the documentation and try to find the correct syntax to be compatible in 5 again.

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