How can you create reusable Vega-Lite components?

Hello everyone,

As a newcomer to Vega, I'm working on a dashboard that displays various metrics for different servers (such as status, number of containers, and names). All data comes from metricbeat/heartbeat queries.

I'm aiming to create a reusable Vega-Lite component where I can specify a server ID when adding the component to the dashboard. Ideally, this would involve some kind of settings input when integrating the component.

I'm not sure if this is feasible or how to incorporate an input variable into my Vega-Lite JSON specification.

Since I'm working within Kibana and only have access to Vega-Lite, and am not familiar with creating components using the Elastic JavaScript Client, I’m seeking guidance on how to achieve this.

Thank you!

From Community Ecosystem to Kibana

Added vega and removed snapshot-and-restore

Hi @ani_Watches,

Welcome! To confirm would this server ID value potentially come from a filter selected in your dashboard? There is a way to pull the clauses from the dashboard filters with tokens such as %dashboard_context-must_clause%. Then you can visualize the data returned from Elasticsearch as you see fit.

The first example in this piece shows how to use these contexts in your data segment in a Vega-Lite specification in Kibana.

If you encounter any particular errors let us know and we'll do our best to help!