The issue is because you are using the wrong aggregation. You have used count
which is going to provide a count of documents, i.e. a number. To retrieve the actual text value of a keyword
field, you must use a top_hit
aggregation.
In the example below I am fetching the value of the most recent network interface name in the data. You will also need to use a size
of 1
to retrieve only a single value.
The actual markdown that prints the value is {{ latest.netif.last.formatted }}
.
You will need to wrap your data value in the other text needed and I expect it would work. Something like:
![label](data:image/png;base64,{{ YOUR DATA VALUE }})