1. Lens #
The visualization editor.
Principle #
Lens suggests the right visualization when you drag a field: a time histogram for @timestamp, top values for a text field, a metric for a number. You can then change the type (bars, areas, table, gauge, heat map, pie chart) without starting over.
| Need | Lens visualization |
|---|---|
| Volume over time | Stacked bars or areas on @timestamp |
| Top N | Sorted horizontal bars |
| Key indicator | Metric (with trend) |
| Distribution | Histogram on a numeric field |
| Geographic distribution | Maps |
| Formula | count(kql='http.response.status_code >= 500') / count() |
Good practice: The Lens formula lets you compute ratios (error rate, cache hit rate) without precomputing in Elasticsearch.
2. Dashboards #
Interactive and shareable.
Good layouts #
- At the top: key indicators (Metric); in the middle: trends; at the bottom: detail tables.
- Add controls (lists of services, environments) to filter the whole dashboard.
- Use drilldowns to go from a panel to Discover or to another filtered dashboard.
- Organize dashboards by space (Spaces) and by tags.
3. Saved objects as code #
Export, import, versioning.
API #
# Exporter tous les dashboards et leurs dépendances
curl -s -X POST localhost:5601/api/saved_objects/_export -u elastic:$PASS \
-H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
-d '{"type": ["dashboard"], "includeReferencesDeep": true}' > dashboards.ndjson
# Importer dans un autre Kibana (ou un autre espace)
curl -s -X POST 'localhost:5601/s/equipe-web/api/saved_objects/_import?overwrite=true' -u elastic:$PASS \
-H 'kbn-xsrf: true' -F file=@dashboards.ndjsonVersioning the .ndjson file in Git and importing it from CI lets you promote a dashboard from staging to production and restore it after a mistake.
Good to know: The /s/<space> prefix targets a Kibana space; without a prefix, it is the default space.My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Advanced Kibana: data views, Lens, dashboards, alerting and reporting
Use Kibana in depth: data views and runtime fields, Discover, Lens and formulas, dashboards and c...
Kibana and Elastic Observability best practices
Checklist for running Kibana in production: versions, security, spaces and roles, versioned dashb...
Visualizing and automating Zabbix: dashboards, Grafana and API
Build dashboards and maps in Zabbix, use Grafana's Zabbix plugin, and automate configuration with...
Prometheus: visualizing your metrics (UI, Grafana and dashboards)
Visualize Prometheus data: the web interface, PromQL graphs, connecting to Grafana, RED and USE d...
Kibana Maps and Canvas: geographic maps and presentations
Build maps with Kibana Maps (document, aggregation and choropleth layers, ES|QL) and dynamic pres...
Elastic path project: centralising and using logs
The validation project of the "Elastic Stack mastery" path: Elastic Agent and Fleet, Logstash, El...
Grafana vs Kibana: which visualization tool to choose?
Discover the fundamental differences between Grafana, the king of multi-source metrics, and Kiban...
Exploring data in Discover: KQL, Lucene and ES|QL
Search and analyze logs in Kibana Discover: filters, KQL, Lucene syntax, and the ES|QL language t...
Alerts, connectors and SLOs in Kibana
Create alert rules in Kibana (Elasticsearch query, ES|QL, custom threshold, logs), configure conn...