Xml/xpath returning an array

I am trying to parse SOAP messages, which take the following form

<Envelope><Header><foo>1</foo></Header><Body><bar>2</bar></Body></Envelope>

I need to get the name of the first element of the Body, which I tried to do using

xpath => { "local-name(/Envelope/Body/*[1])" => "requestType" }

Sadly this returns an array, even when "force_array => false" is set. I can extract the first element of the array using

mutate { add_field => { requestType2 => "%{requestType[0]}" } }

but I would like to know if there is a way to have local-name result in a string rather than an array.

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