Hello,
I have the following multiline XML:
<SharedProject id="1">
<m__modelerProxy id="1">
<m__building id="140">
<m__name>z2</m__name>
<m__common class="SharedBuilding" id="141">
<m__name>z2</m__name>
<m__modelerProxy class="be.lucid.PEB.model.geometry.Zone" reference="140" />
<m__energeticProxy class="Building" id="142">
<attributes id="143">
</attributes>
<labels id="144" />
<name>z2</name>
<pebIdentifer>2</pebIdentifer>
<pebUniqueIdentifer>2</pebUniqueIdentifer>
<proxy class="SharedBuilding" reference="141" />
<plot id="145">
<protectedVolumes id="627">
<ProtectedVolume id="628">
<envelope id="631">
<paroiRoles id="633">
<ParoiRole id="634">
<attributes id="635" />
<labels id="636" />
<name>236</name>
<pebIdentifer>237</pebIdentifer>
<position>SIDE</position>
<paroi id="637">
</ParoiRole>
<ParoiRole id="7395">
<attributes id="7396" />
<labels id="7397" />
<name>237</name>
<pebIdentifer>238</pebIdentifer>
<position>SIDE</position>
<paroi id="797">
</ParoiRole>
...
</paroiRoles>
I want to store only what's inside "ProtectedVolume" field and then split based on the "ParoiRole" field (I want separate events for this field).
I tried running the following input and filter configurations
input {
file {
path => "pathtoxml/file.xml"
start_position => "beginning"
sincedb_path => "NUL"
codec => multiline { pattern => "^Spalanzani" negate => true what => "previous" auto_flush_interval => 2 max_lines=>30000}
}
}
and
filter {
xml { source => "message" target => "theXML" store_xml => true force_array => false }
split { field => "[theXML][m__modelerProxy][m__building][m__common][m__energeticProxy][protectedVolumes][ProtectedVolume][envelope][paroiRoles][ParoiRole]" remove_field => "message"}
mutate
{
remove_field => [ "message"]
}
}
However, I do not know how to remove all the fields before the <ProtectedVolume>
and get the results I want.
Thanks in advance for your help,