Issue parsing xml


I have an xml with format as below:

<DummyXML xmlns="" xmlns:abc="" xmlns:def="">

I need to extract RFN field from the xml. Below is the snippet of the logstash I have written:

xml {
				source => "SourceMessage"
				remove_namespaces => "true"
				xpath => ["/DummyXML/Transaction/def:RFN/text()", "RFN"]

But logstash fails when parsing this file. Below is the snippet of the error that I am getting:

[2019-04-03T14:57:43,373][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<Nokogiri::XML::XPat
h::SyntaxError: /DummyXML/Transaction/def:RFN/text()>,

Can anyone please help me in this.



xpath => ["/DummyXML/Transaction/abcTransaction/RFN/text()", "RFN"]

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.