jolokia: handle multiple multi-dimensional attributes (#1524)

fixes #1481
This commit is contained in:
Torsten Rehn
2016-07-20 15:47:04 +02:00
committed by Cameron Sparr
parent 191608041f
commit 0af0fa7c2e
2 changed files with 9 additions and 1 deletions

View File

@@ -249,7 +249,14 @@ func (j *Jolokia) Gather(acc telegraf.Accumulator) error {
switch t := values.(type) {
case map[string]interface{}:
for k, v := range t {
fields[measurement+"_"+k] = v
switch t2 := v.(type) {
case map[string]interface{}:
for k2, v2 := range t2 {
fields[measurement+"_"+k+"_"+k2] = v2
}
case interface{}:
fields[measurement+"_"+k] = t2
}
}
case interface{}:
fields[measurement] = t