kibana-vega
Create Vega and Vega-Lite visualizations with ES|QL data sources in Kibana. Use when building custom charts, dashboards, or programmatic panel layouts beyond standard Lens charts.
Security Assessment
Detected risks:
About kibana-vega
Custom charts in Kibana that go beyond standard Lens visualizations are the domain of this skill, which builds Vega and Vega-Lite visualizations backed by ES|QL queries. It strictly supports ES|QL data sources and requires Serverless Kibana or version 9.4+ (SNAPSHOT); it will not work reliably on older versions or with Lucene or KQL data-source definitions. A bundled Node script, scripts/kibana-vega.js, drives everything from the command line.
Connection is configured through environment variables, with four documented options: Elastic Cloud using KIBANA_CLOUD_ID and KIBANA_API_KEY, a direct URL with an API key, basic authentication with username and password, and local development via start-local, whose generated .env supplies credentials. Running node scripts/kibana-vega.js test verifies the connection, and the guidance is to stop and fix setup before exploring further if that test fails. The basic workflow then creates, gets, and updates visualizations and creates dashboards, adds panels, and applies layouts - with a dash argument letting specs be piped from stdin so no intermediate file is needed.
A minimal Vega-Lite spec shows the ES|QL pattern: a data.url object with %type%: esql and a query such as FROM logs-* | STATS count = COUNT() BY status, plus mark and encoding definitions. ES|QL data-source options include %context% to apply dashboard filters and %timefield% to enable time ranges with the tstart and tend parameters. The guidance stresses proper JSON rather than HJSON triple-quotes to avoid parse errors.
Dashboard layout uses a 48-column grid, with widths of 48, 24, 16, and 12 for full, half, third, and quarter panels. An above-the-fold discipline keeps primary information within the top roughly 22 height units at 1080p, with height guidelines (h:10 compact bar charts, h:12-13 standard, h:15+ detailed) and an operational-dashboard layout pattern. Panels can be added individually with x, y, w, and h positions or applied wholesale from a layout JSON.
FAQ
What versions and data sources are required?
It strictly supports ES|QL data sources and requires Serverless Kibana or version 9.4+ (SNAPSHOT); older versions or Lucene/KQL sources are not reliably supported.
How is the Kibana connection configured?
Through environment variables, with options for Elastic Cloud (cloud ID and API key), a direct URL with API key, basic auth, or local development via start-local. Run node scripts/kibana-vega.js test to verify.
How do I reference ES|QL data in a spec?
Use a data.url object with %type%: esql and a query string; add %context%: true to apply dashboard filters and %timefield% to enable time ranges.
Can I create visualizations without writing files?
Yes. Pass a dash as the file argument to read the JSON spec from stdin for create, update, and apply-layout commands.
How does the dashboard grid work?
Dashboards use a 48-column grid - 48 for full width, 24 for half, 16 for a third, and 12 for a quarter - and primary content should sit above the fold in the top roughly 22 height units at 1080p.
All Files
10 filesInstall kibana-vega
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
elastic/agent-skills