Visual Builder Markdown - Displaying Strings

Yeah it seems like that would work, but it's not the case, because the structure is a bit different from what it seems. _all is not an array that you could index having those values (or objects of values). It is actually an object with the key being the actual splitted term and an object containing the label and other things, i.e. it looks something like that in your case:

_all = {
  192_168_130_110: { label: '192.168.130.110', ... },
  192_168_100_15: { label: '192.168.100.15', ... },
  dns: { label: 'dns', ... }
}

Since it is no array you cannot access a specific position. The #each helper is still able to iterate over the objects and will write a plain counter into @index (even though you would not be able to access the element in the object like that). It will also write the key into @key in each iteration.

That also why your last example wouldn't work, because label (that you are trying to do an #each on again) would only contain that one string from that one object, not from any of the other entries in that object.

I think we should actually still prefix each series, by the original variable name assigned, so that the object would look in your case like:

_all = {
   source: {
     192_168_130_110: { label: '192.168.130.110', ... },
     // here would be more objects if you would have more then 1 document per split
   },
   destination: {
     192_168_100_15: { label: '192.168.100.15', ... },
   },
   protocol: {
     dns: { label: 'dns', ... }
   }
}

It would still be a bit complex to access that, since you don't know the key, but you could now hack your way around it using the #each, since you know there is only one element in each of the subobjects.

So please feel free to reference that post when creating the feature request issue. Also to be fair, I don't think that we would put it on our roadmap in the near future, since we try to align our markdown implementations again, and I think there won't be any changes to the current implementation anymore, before we have aligned the TSVB markdown and the Kibana markdown implementation, so please don't expect that feature to be there in one of the next minor versions.

Cheers,
Tim