- translate #240 by hand to a patch. Credit to Py Rho for the

original implemenation.
This commit is contained in:
Jordan Sissel 2012-12-27 16:50:19 -08:00
parent 3132c2a5fc
commit 17e1d38a12

View file

@ -207,12 +207,14 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
def replace(event)
# TODO(sissel): use event.sprintf on the field names?
@replace.each do |field, newvalue|
next unless event.include?(field)
event[field] = event.sprintf(newvalue)
end
end # def replace
def convert(event)
@convert.each do |field, type|
next unless event.include?(field)
original = event[field]
# calls convert_{string,integer,float} depending on type requested.