mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- translate #240 by hand to a patch. Credit to Py Rho for the
original implemenation.
This commit is contained in:
parent
3132c2a5fc
commit
17e1d38a12
1 changed files with 2 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue