mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Set the string encoding when parsing XML
Improves upon #1790 Fixes #1803
This commit is contained in:
parent
7395512761
commit
f7d7a7532a
1 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ class LogStash::Filters::Xml < LogStash::Filters::Base
|
|||
|
||||
if @xpath
|
||||
begin
|
||||
doc = Nokogiri::XML(value)
|
||||
doc = Nokogiri::XML(value, nil, value.encoding.to_s)
|
||||
rescue => e
|
||||
event.tag("_xmlparsefailure")
|
||||
@logger.warn("Trouble parsing xml", :source => @source, :value => value,
|
||||
|
@ -115,7 +115,7 @@ class LogStash::Filters::Xml < LogStash::Filters::Base
|
|||
unless value.nil?
|
||||
matched = true
|
||||
event[xpath_dest] ||= []
|
||||
event[xpath_dest] << value.to_str
|
||||
event[xpath_dest] << value.to_s
|
||||
end
|
||||
end # XPath.each
|
||||
end # @xpath.each
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue