Wildcards in logstash remove_field

@Badger i tried to replicate the below ruby code,

I used something like below and was getting error,

ruby { code => 'event['result'].keys.each { |k| event['result'].remove(k) if k.end_with?('.value')' }

can you provide some ruby code example for my scenario.

Thanks
Gautham