Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 43 ยท Getting Started

Kibana: Discover, Dev Tools, Dashboards and Lens

A guided tour of Kibana for Elasticsearch users: the Dev Tools console, data views, Discover with KQL, Lens visualizations, dashboards and saved objects.

Kibana is the web interface for Elasticsearch. You do not need it to run a cluster, but it makes everyday work much faster: a console for sending requests, a browser for your documents, charts, dashboards, and the screens that manage security, snapshots and pipelines. Most examples in this tutorial are written so you can paste them into Kibana's console.

Kibana cannot run on this site, so this lesson describes the screens in words and diagrams, shows the requests Kibana sends behind the scenes as read-only code, and gives you two small JavaScript stand-ins: one turns a simple search string into a query, and one computes what a chart panel computes. They are not Kibana's code.

The parts of Kibana you use most

Dev Tools Type requests, see responses.
Discover Browse and filter documents.
Lens Drag fields to build charts.
Dashboards Many charts on one page.

Every screen ends up sending ordinary Elasticsearch queries.

1 / 2

Dev Tools: the console

Open Dev Tools in the main menu and choose Console. It has a request editor on the left and a response pane on the right. You type requests in the same short form this tutorial uses, with the method and path on the first line and a JSON body below:

HTTP
GET /products/_search
{
  "query": { "match": { "name": "trail shoe" } },
  "size": 3
}

Put the cursor inside a request and press the green play button or Ctrl+Enter (Cmd+Enter on macOS) to run it. The console handles the connection and authentication for you, so no curl, no passwords in the command line, no quoting problems. It also offers autocomplete for endpoints and query fields, formats JSON with Ctrl+I, and keeps a history of what you ran. The Search Profiler and Grok Debugger tabs next to it help with slow queries and with grok patterns.

Write requests in the console first, then copy them into your application code. The official clients take the same JSON bodies.

Data views and Discover

Kibana does not look at an index directly. It uses a data view (called an index pattern in older versions): a saved definition such as web-logs-* plus the name of the main time field, usually @timestamp. A pattern with a wildcard covers a whole family of daily or versioned indexes at once (see searching many indices). Creating one is a one-time step under Stack Management.

Discover shows the documents of a data view:

  • A time picker at the top right limits results to a range such as "last 15 minutes" or an absolute interval.
  • A histogram shows how many documents fall into each time bucket.
  • A search bar accepts a query written in KQL (Kibana Query Language), the friendly syntax for this bar.
  • A field list on the left lets you add columns, see the most common values of a field, and click a value to add a filter.
  • Expanding a row shows the full document as a table or as JSON.

KQL is meant to be quick to type:

TEXT
status >= 500 and service : "checkout"
not method : GET
message : "timed out" or tags : retry
url.path : /api/*

field : value is a match, and, or, not combine them, comparison operators work on numbers and dates, and * is a wildcard. Behind the bar, Kibana builds a bool query like the ones in compound queries and adds a range filter on the time field from the time picker.

Stand-in: from KQL to a query

This tiny converter understands only field : value, numeric comparisons and and. It prints the Query DSL that corresponds to what you typed. Real KQL is far richer.

JS A tiny KQL-to-Query-DSL converter

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The time picker's range always arrives as a filter, so it does not change relevance scores and can be cached.

Lens, visualizations and dashboards

Lens is the main chart builder. You pick a data view, then drag fields onto the canvas. Kibana suggests a chart type (bar, line, area, table, pie, metric, map and others). Each axis or slice is an aggregation:

You drag... Kibana asks Elasticsearch for...
@timestamp on the horizontal axis a date_histogram
a count of records on the vertical axis the document count of each bucket
service as a breakdown a terms aggregation
took_ms with "average" an avg metric

Dashboards place many saved panels on one page, sharing one time picker and one search bar. Clicking a bar in a chart can add a filter to the whole dashboard, which is how people explore. You can set an auto-refresh interval for a wall display, and share a dashboard by link or export a report.

Stand-in: what a chart panel computes

This example does by hand what a Lens line chart of "errors per 10 minutes, split by service" asks Elasticsearch to do.

JS A date histogram split by service

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Saved objects and Stack Management

Everything you build is stored as a saved object in a hidden Kibana index: data views, saved searches, visualizations, dashboards. Under Stack Management โ†’ Saved Objects you can inspect them, export them as an NDJSON file, and import them into another Kibana. That is how you move dashboards from a test system to production. Organize work with spaces, separate areas with their own objects and permissions.

Stack Management is also where administrators handle indexes, templates, ingest pipelines, snapshot policies, users and roles, and API keys. These screens call the same APIs you read about in ingest pipelines and security and operations. Access to each screen is controlled by roles, so a dashboard viewer can be given a role that sees only dashboards.

Kibana has its own configuration (kibana.yml) and talks to Elasticsearch over HTTP with its own service credentials. Keep its version in line with Elasticsearch: a Kibana newer than the cluster is not supported.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is a data view in Kibana?

    A data view (formerly index pattern) tells Kibana which indexes to query, often with a wildcard, and which field holds the timestamp.
  2. 2. Where would you quickly try a raw Query DSL request?

    The Dev Tools console sends requests exactly as typed and shows the response.
  3. 3. In Lens, dragging a timestamp field to the horizontal axis becomes which aggregation?

    A time axis is a date_histogram, with one bucket per interval.
  4. 4. How do you move a dashboard from a test Kibana to a production one?

    Saved objects can be exported to a file and imported elsewhere.

Summary

  • Kibana is the web interface: Dev Tools for requests, Discover for browsing, Lens and dashboards for charts, Stack Management for administration.
  • A data view names the indexes and the time field; Discover adds a time picker, a histogram and the KQL search bar.
  • Every screen turns into ordinary queries and aggregations, so what you learn in the Query DSL carries over.
  • Dashboards, searches and data views are saved objects that you can export, import and group in spaces.

Next: put documents into your indexes and change them in documents and indexes.