Skip to content

Commit

Permalink
- Don't do any rename action if the field doesn't exist (LOGSTASH-757)
Browse files Browse the repository at this point in the history
  The test previously written to verify this bug now passes.
  • Loading branch information
jordansissel committed Dec 11, 2012
1 parent 5b401ae commit a0cfc1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/logstash/filters/mutate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def remove(event)
def rename(event)
# TODO(sissel): use event.sprintf on the field names?
@rename.each do |old, new|
event[new] = event[old]
event.remove(old)
next unless event.include?(old)
event[new] = event.remove(old)
end
end # def rename

Expand Down

0 comments on commit a0cfc1d

Please sign in to comment.