Hi
I am trying to parse below XML file in logstash.
<OrderEvent actionCode = "5">
<OrderNumber>ORD12345</OrderNumber>
<VendorNumber>V11111</VendorNumber>
</OrderEvent>
I was able to successfully parse OrderNumber and VendorNumber from the log. But I am not able to fetch actionCode from the XML.
Can anyone please help me.
Below is the snippet of the logstash for XML parsing.
if [fields][log_type] == "XMLs" {
xml {
source => "message"
store_xml => false
namespaces => {
"xsl" => "http://www.w3.org/1999/XSL/Transform"
"xhtml" => "http://www.w3.org/1999/xhtml"
}
xpath => ["/OrderEvent/title()", "ActionCode","/OrderEvent/OrderNumber/text()", "OrderNumber","/OrderEvent/VendorNumber/text()", "VendorNumber"]
}
mutate {
add_field => ["Promotion_Source", "XMLs"]
}
}
Thanks