How to build a Vega tree using csv data stored in my index

Your spec is just containing the data part, it's not mapping this data to any visual output.

To get started with vega there is lot's of documentation available, e.g. on the vega website: http://vega.github.io/. Google also gave me this example for a vega tree, might be a good starting point: https://bl.ocks.org/ijlyttle/c535a3172c9f7fabf316e18d5ab7b086 . For a complex chart like this I recommend starting to build it in the vega editor with inline dummy data, and once everything's working there, moving it into Kibana and connecting it to the real data set. Otherwise you have to deal with both Elasticsearch querying and vega charting at once.

To learn more about how to query elasticsearch within a vega spec in Kibana check out the documentation: https://www.elastic.co/guide/en/kibana/current/vega-querying-elasticsearch.html