# Breaking changes in ruby filter plugin to ther version of 5.0.1

**URL:** <https://discuss.elastic.co/t/breaking-changes-in-ruby-filter-plugin-to-ther-version-of-5-0-1/67470>\
**Category:** Logstash\
**Created:** [November 29, 2016, 10:48am UTC](https://discuss.elastic.co/t/breaking-changes-in-ruby-filter-plugin-to-ther-version-of-5-0-1/67470 "2016-11-29T10:48:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jamal](https://discuss.elastic.co/u/jamal)\
**Post date:** [November 29, 2016, 10:48am UTC](https://discuss.elastic.co/t/breaking-changes-in-ruby-filter-plugin-to-ther-version-of-5-0-1/67470/1 "2016-11-29T10:48:19Z")

</div>

I upgrade logstash from 2.1.0 to 5.0.1 version i have error in filter-plugin-rubby.  
here is the code that i had in version 2.1.0 and work correctlly  
ruby {  
code =\> "require 'digest/md5';  
event['@metadata']['computed\_id'] = Digest::MD5.hexdigest(event['message'])"  
}

I have studied break changes but i cant make it correct, any one could help me

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 29, 2016, 10:49am UTC](https://discuss.elastic.co/t/breaking-changes-in-ruby-filter-plugin-to-ther-version-of-5-0-1/67470/2 "2016-11-29T10:49:53Z")

</div>

Here's what you're looking for: [https://www.elastic.co/guide/en/logstash/5.0/breaking-changes.html#\_ruby\_filter\_and\_custom\_plugin\_developers](https://www.elastic.co/guide/en/logstash/5.0/breaking-changes.html#_ruby_filter_and_custom_plugin_developers)

---

<div class="post-metadata">

**Author:** ![jamal](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jamal](https://discuss.elastic.co/u/jamal)\
**Post date:** [November 29, 2016, 10:53am UTC](https://discuss.elastic.co/t/breaking-changes-in-ruby-filter-plugin-to-ther-version-of-5-0-1/67470/3 "2016-11-29T10:53:29Z")

</div>

thank you for answearing but I checked the link but i cant solve the problomes if you see the code and say me what is the problome, please

---

<div class="post-metadata">

**Author:** ![aeva\_assured](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@aeva\_assured](https://discuss.elastic.co/u/aeva_assured)\
**Post date:** [November 30, 2016, 1:29am UTC](https://discuss.elastic.co/t/breaking-changes-in-ruby-filter-plugin-to-ther-version-of-5-0-1/67470/5 "2016-11-30T01:29:52Z")

</div>

> [@jamal](#):
>
> ruby {  
> code =\> "require 'digest/md5';  
> event['@metadata']['computed\_id'] = Digest::MD5.hexdigest(event['message'])"  
> }

corrected for LS5+ would look something like this:

> [@jamal](#):
>
> ruby {  
> code =\> "require 'digest/md5';  
> event.set('[@metadata][computed\_id]'), Digest::MD5.hexdigest(event.get('[message]')"  
> }

Have you tried that?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 28, 2016, 1:30am UTC](https://discuss.elastic.co/t/breaking-changes-in-ruby-filter-plugin-to-ther-version-of-5-0-1/67470/6 "2016-12-28T01:30:12Z")

</div>

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