Skip to content

Commit

Permalink
Merge pull request #42 from kimamula/fix_issue_40
Browse files Browse the repository at this point in the history
Fix #40
  • Loading branch information
sonots authored Aug 21, 2016
2 parents c260fc3 + da2780d commit 074e288
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/out_record_reformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def prepare_placeholders(placeholder_values)
end
elsif value.kind_of?(Hash) # record, etc
value.each do |k, v|
placeholders.store("${#{k}}", v) # foo
placeholders.store("${#{k}}", v) unless placeholder_values.key?(k) # foo (Prevent overriding the reserved placeholders with 'unless' check)
placeholders.store(%Q[${#{key}["#{k}"]}], v) # record["foo"]
end
else # string, interger, float, and others?
Expand Down
1 change: 1 addition & 0 deletions test/test_out_record_reformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def emit(config, use_v1, msgs = [''])
record = {
'eventType0' => 'bar',
'message' => msg,
'tag' => 'baz',
}
record = record.merge(msg) if msg.is_a?(Hash)
d.emit(record, @time)
Expand Down

0 comments on commit 074e288

Please sign in to comment.