Kibana Guide: Console

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

Checked on 2026-11-11 against Kibana 9.5.x.

What you build

You use Dev Tools → Console as a scratchpad for the HTTP APIs of the stack. You count the Bookshelf log records, search them with a request body that Console indents for you, put the index name in a variable, find an earlier request in the history, copy a request as a cURL command, and call the Kibana API with the prefix kbn:. The last request returns the version of Kibana.

Dev Tools Console of Kibana 9.5 after sending GET kbn:/api/status: the output pane shows the answer of the Kibana API with the name kibana, the version number 9.5.6 and the overall status level available

Before you start

  • Start the Kibana profile of the hands-on lab and wait about a minute:

    cd lab
    docker compose --profile kibana up -d
  • Open http://localhost:5601 and sign in as elastic with the password lab-elastic-password. When Kibana opens its full-screen welcome page, click Explore on my own.

  • Do the previous guide, Spaces, roles and users. Sign in as elastic: the user of that guide has no access to Dev Tools.

  • Wait about two minutes after the start, with the load generator in its default mode, so that the log data stream logs-generic.otel-default holds records.

  • Console needs no licence beyond the basic one; the lab runs a trial licence anyway. A request runs with the privileges of the signed-in user.

  • The guide was checked on Elasticsearch and Kibana 9.5.6. The figures are drawings of the Kibana 9.5 user interface, not screenshots, so small details can differ from your screen. The menu of Request options, the Variables editor and the History list are drawn generically, and the responses in the figures are samples; look for a control by its name when it is not where a figure shows it. A highlighted box with a number marks the control of the step with the same number.

Steps

Everything happens in Dev Tools. The page has the tabs Console, Search Profiler, Grok Debugger and Painless Lab; this guide uses Console, which has the sub-tabs Shell, History and Config. The editor is at the left and the response at the right. As you type, Console may suggest methods, index names and fields; accept a suggestion with Enter or Tab, or ignore it and keep typing.

Open Console

  1. Click the menu button (Toggle primary navigation) at the left of the second bar.

  2. Under Management, click Dev Tools.

    Kibana 9.5 with the primary navigation open and the Management section listing Dev Tools, Workflows, Integrations, Fleet, Osquery, Stack Monitoring, Cloud Connect, Stack Management and Streams; callout 1 marks the menu button of the second bar and callout 2 marks Dev Tools
  3. On the tab Console and the sub-tab Shell, click line 1 of the editor. The output pane says "Enter a new request" until you send one.

    Dev Tools Console of Kibana 9.5 on the Shell sub-tab with an empty editor on the left and the message Enter a new request in the output pane on the right; the editor is marked by callout 3

Send a request

  1. Type the request line, which counts the records of the Bookshelf log data stream:

    GET logs-generic.otel-default/_count
  2. Click the green button Click to send request at the right of the line, or press Ctrl-Enter (Cmd-Enter on macOS) with the cursor on the request.

    Dev Tools Console of Kibana 9.5 with the request GET logs-generic.otel-default/_count typed on line 1 and marked by callout 4; the green button that sends the request is marked by callout 5
  3. Read the output pane: the field count is the number of log records, and _shards says that the one shard answered. The number grows while the load generator runs.

Search with a request body and auto-indent

  1. Select the text of the editor (Ctrl-A or Cmd-A) and type the first line of a search request:

    GET logs-generic.otel-default/_search
  2. Press Enter and type the body of the request on a single line. It returns two records whose attributes.status is 200:

    {"size":2,"query":{"match":{"attributes.status":200}}}
    Dev Tools Console of Kibana 9.5 with the request GET logs-generic.otel-default/_search on line 1, marked by callout 7, and its JSON body written on one line 2, marked by callout 8; the output pane still shows the previous response with a count
  3. Click Request options (the wrench at the right of the first line) and choose the entry that indents the request, named Auto indent in the figure. The entry names can differ a little between releases.

    Dev Tools Console of Kibana 9.5 with the Request options wrench marked by callout 9 and its menu open; the entry that indents the request, Auto indent, is highlighted
  4. The body now spreads over several lines with one key per line. Click the green button to send the request.

    Dev Tools Console of Kibana 9.5 with the search request indented over nine lines, the keys size and query and the match on attributes.status with 200; the green button that sends the request is marked by callout 10
  5. Read the output pane. hits.total.value is the number of records with the status 200, and hits.hits holds the two documents asked for, each with its _source, including body.text such as Served /api/search.

    Dev Tools Console of Kibana 9.5 with the response of the search in the output pane: took, hits with a total value and a list of documents whose body text is Served /api/search and whose attributes.status is 200; the response is marked by callout 11

Use a variable

  1. Click Variables at the bottom of the editor.

    Dev Tools Console of Kibana 9.5 with the request GET logs-generic.otel-default/_count and its response; the Variables button at the bottom of the editor is marked by callout 12
  2. Add a variable with the name index and the value logs-generic.otel-default.

  3. Save the variables and close the editor.

    Variables editor of the Dev Tools Console of Kibana 9.5 with one variable: the name index is marked by callout 13 and its value is the index logs-generic.otel-default; the Save button is marked by callout 14
  4. Replace the text of the editor by a request that names the variable in the path:

    GET ${index}/_count
  5. Click the green button. Console replaces ${index} by the value before it sends the request, and the response is the same count as in step 6.

    Dev Tools Console of Kibana 9.5 with the request GET and the variable index between the characters dollar and braces in front of the path _count, marked by callout 15; the green button that sends the request is marked by callout 16

Find an earlier request and copy it as cURL

  1. Click the sub-tab History.

  2. In the list, click the entry of an earlier request, for example the _search request of step 7, to look at it and use it again.

    History sub-tab of the Dev Tools Console of Kibana 9.5 listing three earlier requests with the time they were sent; the History sub-tab is marked by callout 17 and the first request of the list by callout 18
  3. Go back to the sub-tab Shell, type GET logs-generic.otel-default/_count again, and leave the cursor on that line.

  4. Open Request options and choose the entry that copies the request as a cURL command (Copy as cURL in the figure).

    Dev Tools Console of Kibana 9.5 with the request GET logs-generic.otel-default/_count and the Request options menu open; the entry that copies the request as a cURL command, Copy as cURL, is marked by callout 20
  5. Paste the command into a terminal. It targets the address of Elasticsearch that Kibana is configured with, which inside the lab network is http://elasticsearch:9200; replace it with http://localhost:9200 and add the credentials of the lab:

    curl -X GET "http://localhost:9200/logs-generic.otel-default/_count" -u elastic:lab-elastic-password

Call a Kibana API

  1. In the sub-tab Shell, replace the text of the editor by a request to the Kibana API. The prefix kbn: sends the request to Kibana instead of Elasticsearch:

    GET kbn:/api/status
  2. Click the green button.

    Dev Tools Console of Kibana 9.5 with the request GET kbn:/api/status typed on line 1 and marked by callout 22; the green button that sends the request is marked by callout 23
  3. Read the output pane: version.number is 9.5.6 in the lab, the same value as curl -s -u elastic:lab-elastic-password http://localhost:5601/api/status returns in a terminal.

Check the result

The output pane of step 24 shows the status of Kibana with its version, so Console reached both services: Elasticsearch for the requests of steps 4 to 16, and Kibana for the request with kbn:. To see the counts react to the load, send step 6 twice with the load generator in the mode log-errors and compare the result:

curl -X POST localhost:8090/mode/log-errors

Restore normal traffic afterwards:

curl -X POST localhost:8090/mode/normal

Variations

  • Replace the match in the body by {"match":{"severity_text":"ERROR"}} to list the error records, which exist while the load generator is in the mode failing or log-errors.

  • Send GET kbn:/api/data_views to list the data views of the default space; the answer includes Bookshelf logs (guides).

  • Use Export requests to save the editor as a file, and Import requests to load it again.

What can go wrong

Symptom Cause Fix

The output pane still says "Enter a new request"

The request was not sent: the cursor was not on a request line, or the green button was not clicked.

Click inside the request and click the green button.

The response is index_not_found_exception

The index name has a typo, or the data stream does not exist yet.

Type logs-generic.otel-default exactly and wait two minutes after the start.

The response is a parse error

The JSON body has a missing quote, comma or brace.

Use the auto-indent entry of Request options: it fails on the same mistake, which shows where it is.

The response is a 404 for the path ${index}/_count

The variable was not saved, or its name differs from the one in the request.

Open Variables and check the name index and its value.

A kbn: request answers Not Found

The path is not a Kibana API path.

Start the path with /api/, as in kbn:/api/status.

Clean up

The guide creates nothing in Elasticsearch or Kibana. The variable and the history stay in the browser; remove the variable from Variables if you do not need it, and restore the load generator with curl -X POST localhost:8090/mode/normal if you changed it.

Where to go next