Skip to content

Commit

Permalink
Fix the 'unknown transform_keys of UnmodifiableMap' error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mashhurs committed Apr 10, 2024
1 parent df509f8 commit 0795298
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion logstash-core/lib/logstash/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def normalize_encoding(data)
data.map { |item| normalize_encoding(item) }
when Hash
# origin key might change when normalizing, so requires transformation
data.transform_keys { |key| normalize_encoding(key) }
modifiable_hash = data.to_hash # if coming from jruby objects such as UnmodifiableMap
modifiable_hash.transform_keys { |key| normalize_encoding(key) }
.transform_values { |value| normalize_encoding(value) }
else
data # use as it is
Expand Down

0 comments on commit 0795298

Please sign in to comment.