- Skill ID
- elastic/agent-skills/kibana-dashboards
- Publisher
- elastic
- Repository
- agent-skills
- Installs
- 0
- Files
- 12
- Requires
- Kibana 9.4 or later (Dashboards and Visualizations APIs) with matching
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
elastic/agent-skills/kibana-dashboardsInstalls these files- SKILL.md
- assets/bar-chart-esql.json
- assets/dashboard-basic.json
- assets/dashboard-with-visualizations.json
- assets/datatable.json
- assets/demo-dashboard.json
- assets/ecommerce-analytics-dashboard.json
- assets/line-chart-timeseries.json
- assets/metric-esql.json
- references/chart-types-reference.md
- references/dashboard-api-reference.md
- references/lens-api-reference.md
What this skill tells the agent
Kibana Dashboards and Lens Visualizations
Create, update, and delete Kibana dashboards and standalone Lens visualizations using the Kibana 9.4+ Dashboards and Visualizations APIs. Produce minimal, diffable JSON bodies; prefer inline panel definitions over library references; and choose the correct dataset type (data view vs ES|QL) before writing metrics or chart layers.
<!-- begin-partial: preamble -->
Environment Configuration
This skill executes Elasticsearch operations through the elastic CLI. If the `elastic` CLI is not installed, tell the user what it is needed for. Do not guess credentials, call the HTTP API directly, or attempt other workarounds.
This skill references operations in HTTP-shorthand form (e.g., GET /, GET /_cat/indices, GET /{index}/_mapping, GET /{index}/_settings/index.mode, POST /_query). The Operations table at the end of this document maps each shorthand to the equivalent elastic CLI command — always use the CLI rather than calling the HTTP API directly.
<!-- end-partial: preamble -->
Prerequisites
Version requirement: Kibana 9.4+ (Dashboards and Visualizations APIs).
ES|QL placement:
- Standalone library charts:
PUT kbn:/api/visualizations/{id}withdata_source.type: "esql". - ES|QL panels embedded in a dashboard: inline
vispanelconfigwithdata_source.type: "esql"viaPUT kbn:/api/dashboards/{id}. - Do not use
data_source.type: "data_view_reference"or index-pattern aggregations when the user explicitly requests ES|QL — the persisted Lens state must use a text-based ES|QL datasource (textBased/esql), not a data-view count operation.
Process
- Verify Kibana connectivity. Call
GET kbn:/api/status. If the call fails, stop and surface the error — do not guess endpoints or credentials. Readversion.numberto confirm the cluster meets the 9.4+ requirement.
- Classify the task. Decide whether the user needs a dashboard (collection of panels, optional time range), a standalone Lens visualization (library item referenced by id or used alone), or both. Determine whether a deterministic saved-object id was supplied — when given, use upsert (
PUT) with that id rather thanPOST(which auto-generates ids).
- Choose the dataset type before building metrics or layers.
| User intent | Dataset | Metric / axis pattern | |
|---|---|---|---|
| Simple count or aggregation on a saved data view | data_source.type: "data_view_reference" with ref_id | metrics: [{ type: "primary", operation: "count" }] (or other aggregation operations) | |
| Ad-hoc index pattern | data_source.type: "data_view_spec" with index_pattern and time_field | Same aggregation operation fields | |
| ES\ | QL query (explicit or complex logic) | data_source.type: "esql" with query | metrics: [{ type: "primary", column: "<alias>" }] or layer axes { column: "<alias>" } — never operation: "count" on the metric |
Write the aggregation in the ES|QL query (STATS count = COUNT()), then reference the resulting column by name.
- Build a dashboard body when creating or updating dashboards. The request body is flat —
title,panels, and optionaltime_rangeat the root. Do not wrap in{ data: ... }on write. Required fields:
title— exact string the user requested.panels— array; use[]when the user asks for an empty dashboard (do not omit the key or invent panels).time_range— when the user specifies a default time filter, set{ "from": "<expr>", "to": "<expr>" }(for example{ "from": "now-7d", "to": "now" }). Supplyingtime_rangepersists the dashboard time filter on open (equivalent to enabling time restore in the UI).
Upsert with a deterministic id:
{
"title": "Sales Overview",
"panels": [],
"time_range": { "from": "now-7d", "to": "now" }
}Call PUT kbn:/api/dashboards/eval-sales-overview with the body above when the user supplies that id.
Inline ES|QL metric panel example (inside panels):
{
"type": "vis",
"id": "total-requests",
"grid": { "x": 0, "y": 0, "w": 12, "h": 6 },
"config": {
"title": "Total Requests",
"type": "metric",
"data_source": {
"type": "esql",
"query": "FROM logs* | STATS count = COUNT()"
},
"metrics": [{ "type": "primary", "column": "count" }]
}
}Prefer inline config properties over config.ref_id for portable dashboards. Read Dashboard API Reference for panel types, grid layout, and copy workflows.
- Build a standalone Lens visualization when the user asks for a library chart. Use the Visualizations API. Upsert with
PUT kbn:/api/visualizations/{id}when an id is supplied; otherwisePOST kbn:/api/visualizationsand report the generated id from the response.
ES|QL metric (total count from logs):
{
"type": "metric",
"title": "Total Requests",
"data_source": {
"type": "esql",
"query": "FROM logs* | STATS count = COUNT()"
},
"metrics": [{ "type": "primary", "column": "count" }]
}Call PUT kbn:/api/visualizations/eval-total-requests when that id is required. The API persists a Lens saved object whose datasource state uses ES|QL (textBased / esql), not an index-pattern aggregation.
Read Lens API Reference and Chart Types Reference for xy, gauge, heatmap, and other chart schemas.
- Execute and confirm. Perform the write with
PUT kbn:/api/dashboards/{id}orPUT kbn:/api/visualizations/{id}(orPOSTwhen no id is supplied). Confirm withGET kbn:/api/dashboards/{id}orGET kbn:/api/visualizations/{id}. Report the id and title back to the user — do not claim success without a successful read-back.
- List, export, or delete when requested. Call
GET kbn:/api/dashboardsorGET kbn:/api/visualizationsto discover existing objects. CallDELETE kbn:/api/dashboards/{id}orDELETE kbn:/api/visualizations/{id}to remove objects. For bulk export or import of saved objects, callPOST kbn:/api/saved_objects/_exportorPOST kbn:/api/saved_objects/_import.
Dashboard grid
Dashboards use a 48-column grid. On 16:9 screens, roughly 20–24 rows fit above the fold — target 8–12 panels in that band.
| Width | Columns | Height (rows) | Use case |
|---|---|---|---|
| Full | 48 | 14–16 | Wide time series, tables |
| Half | 24 | 10–12 | Primary charts |
| Quarter | 12 | 5–6 | KPI metrics |
| Sixth | 8 | 4–5 | Dense metric rows |
Grid packing: When stacking rows, set the next panel's y to the previous panel's y + h. Panels sharing a row should use the same h. Do not add markdown panels as dashboard titles — use descriptive chart titles instead.
ES|QL patterns
More from elastic
Use this skill in a project
Open any RiverX project, search the Skills panel for elastic/agent-skills/kibana-dashboards, and install it in one click.
