My XML contains an array of predefined elements, but I can't pick up the array. Here is the XML structure:
<?xml version='1.0' encoding='UTF-8'?>
<results preview='0'>
<meta>
<fieldOrder>
<field>values(metric_name)</field>
</fieldOrder>
</meta>
<result offset='0'>
<field k='values(metric_name)'>
<value><text>process.cpu.avg</text></value>
<value><text>process.cpu.last</text></value>
<value><text>process.cpu.max</text></value>
<value><text>process.cpu.min</text></value>
<value><text>process.disk.avg</text></value>
<value><text>process.disk.last</text></value>
<value><text>process.disk.max</text></value>
<value><text>process.disk.min</text></value>
<value><text>process.ram.avg</text></value>
<value><text>process.ram.last</text></value>
<value><text>process.ram.max</text></value>
<value><text>process.ram.min</text></value>
</field>
</result>
</results>
I tried to make a struct that looks like:
type Metrics struct {
Value []string `xml:">text"`
}
But it gives me empty array at output.