Kibana Guide: Explore Logs in Discover

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 search the Bookshelf log records in Discover and shape what you see: you narrow the time range, write KQL queries, add filter pills, put the fields you care about in columns, read one document in full and split the histogram by severity. At the end you save the result as the Discover session Bookshelf errors (guides), which a dashboard can show as a panel later.

Result: Discover with the saved session Bookshelf errors (guides), the query severity_text : ERROR, the histogram broken down by severity_text and the table columns severity_text, attributes.status and attributes.uri

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, Upload a file and create a data view. This guide needs the data view Bookshelf logs (guides) with the index pattern logs-generic.otel-default and the time field @timestamp.

  • The searches need error records to find. Make the Bookshelf service fail for a minute, wait a minute more, and then restore normal traffic. The records stay in Elasticsearch, and the default time range of 15 minutes covers them for the rest of this guide:

    curl -X POST localhost:8090/mode/failing
    sleep 60
    curl -X POST localhost:8090/mode/normal
  • The fields used are severity_text (INFO or ERROR), attributes.status (a number such as 200, 404 or 500), attributes.uri (the path of the request) and body.text (the log line).

  • The lab runs with a trial licence. Discover itself needs only the basic licence; the tabs Patterns and Field statistics that you see in the result area need the trial and are the topic of the next guide.

  • The figures are drawings of the Kibana 9.5 user interface, not screenshots, so small details can differ from your screen. A highlighted box with a number marks the control of the step with the same number. Where Kibana’s own screen was not drawn in detail (for example the save dialog), the figure is generic and the step names the control by its role.

Steps

Discover is one screen with a few regions. The map shows them with numbers; come back to it when a control is not where you expect it.

Map of Kibana 9.5 Discover with eight numbered regions: the breadcrumbs, the session tabs, the top actions, the data view and query row, the field list, the histogram, the Documents Patterns and Field statistics tabs, and the table toolbar

Open Discover and choose the data

  1. Click the menu button, Toggle primary navigation, and under Analytics click Discover. Discover opens with one session tab named Untitled.

  2. Open the data view picker at the left of the filter row and choose Bookshelf logs (guides). The picker shows the data view that Discover used last, or the default one.

    Discover of Kibana 9.5 with the data view picker open under the filter row, listing Bookshelf logs (guides), Kibana Sample Data Logs, Kibana Sample Data eCommerce and APM; the entry Bookshelf logs (guides) is marked by callout 2
  3. Check the time picker at the right of the filter row. It must say Last 15 minutes, the default. The histogram under the filter row draws the number of log records over that range, and the Documents tab under it shows their total.

  4. Zoom in: drag across a few bars of the histogram with the mouse. Discover sets the time range to the part you selected and redraws the chart and the table. The time picker now shows that absolute range. Set it back to Last 15 minutes before the next step.

    Discover with the data view Bookshelf logs (guides): callout 3 marks the time picker Last 15 minutes and callout 4 marks a dragged selection across the bars of the histogram that zooms the time range in

Search with KQL

  1. Search a value of a field. Type the query below in the query box, which says "Search and filter the discover page", and press Enter. Field name, a colon, the value; the text in quotes must match exactly:

    severity_text : "ERROR"
    Discover with the query severity_text : ERROR typed into the query box, marked by callout 5; the histogram and the Documents tab count only the error log records
  2. Combine two conditions with and, and use a range with a comparison operator. The query below keeps the error records whose status is 500 or more:

    severity_text : "ERROR" and attributes.status >= 500
    Discover with the query severity_text : ERROR and attributes.status >= 500 in the query box, marked by callout 6, joining two conditions with and and a range
  3. Use or to accept either of two values:

    attributes.status : 404 or attributes.status : 500
  4. Use a star as a wildcard. The star stands for any characters and works only on a value written without quotes; the query below finds the paths that start with /api/b, such as /api/books:

    attributes.uri : /api/b*
    Discover with the query attributes.uri : /api/b* in the query box, marked by callout 8; the star stands for any characters, so the documents of /api/books and /api/books/ followed by an id match

Filter with pills

  1. Clear the query box (select its text, delete it and press Enter), so that only the filters below narrow the search.

  2. Click Add filter, the plus button at the left of the query box. In the dialog Add filter that opens, open Select a field and choose severity_text, open Select operator and choose is (the list also has is not, is one of, is not one of, exists and does not exist), type ERROR as the value and click Add filter. A pill labelled with the field and the value appears under the filter row.

  3. Click the pill. Its menu offers Pin across all apps, Edit filter, Exclude results, Temporarily disable and Delete; choose Pin across all apps. A pinned filter stays in force when you move to other apps, such as a dashboard.

  4. Add a second filter on the field attributes.uri with the value /api/search. Click its pill and choose Exclude results. The pill now reads as a negation, NOT attributes.uri: /api/search.

  5. Open the menu of the second pill again and choose Temporarily disable. The pill is greyed out and the documents that it excluded come back; open the menu again and choose the same entry, which now reads Re-enable, to switch it on again. The entry Delete removes a pill for good.

    Discover with two filter pills under the filter row, severity_text: ERROR pinned and NOT attributes.uri: /api/search excluded, and the menu of the first pill open; callout 10 marks the Add filter button, callout 11 the first pill, callout 12 the second pill and callout 13 the menu action that disables a pill

Read the fields and the documents

  1. In the field list at the left, click the field name severity_text. A popover opens with the most frequent values of the field and the share of the documents that carry each, so INFO and ERROR with their percentages. The values come from a sample of the documents in the time range.

    Discover with the field severity_text clicked in the field list (callout 14) and a popover next to it showing its most frequent values INFO and ERROR with their share of the sampled documents
  2. Point at the field severity_text in the list and click its button Add field as column. The table gets a column with that name.

  3. Do the same for attributes.status.

  4. Do the same for attributes.uri. The table now has the columns timestamp, severity_text, attributes.status and attributes.uri instead of the Summary column.

    Discover with the Add field as column buttons of the field list: severity_text (callout 15), attributes.status (callout 16) and attributes.uri (callout 17); the table still has the timestamp and Summary columns
  5. Click the expand button at the start of the first row (Toggle dialog with details). A flyout titled Document opens at the right with the tabs Table and JSON; the table lists every field of the document and its value, including body.text, and has the switches Selected only and Hide null fields.

  6. In the flyout, click the icon View surrounding documents next to Actions at the top: it shows the documents recorded just before and after this one. Use it to read what the service logged around an error. Close the flyout, or use the browser’s back button, to return to the table.

    Discover with the table columns timestamp, severity_text, attributes.status and attributes.uri and the details flyout of the first document open; callout 18 marks the expand button of the row and callout 19 marks the entry that opens the surrounding documents

Break the chart down

  1. Above the histogram, click No breakdown.

  2. In the list that opens, choose the field severity_text. The bars are now stacked, one colour per value, so you see when the ERROR records appeared among the INFO ones. The button shows the field name.

    Discover with the No breakdown button of the histogram clicked (callout 20) and a list of fields open under it; the field severity_text is marked by callout 21

Use tabs and save the session

  1. Click New tab, the plus button next to the session tab at the top. A second tab opens: a separate Discover session with its own search, so you can compare two searches side by side without losing the first.

  2. Click the first tab to return to the search you built. The result tabs Documents, Patterns and Field statistics under the histogram are a different thing: they change what the area below shows, and the next guide uses the last two.

    Discover with two session tabs named Untitled; the second one is active; callout 22 marks the New tab button next to the tabs and callout 23 marks the first tab, to which the guide returns
  3. Click Save at the top right.

  4. In the dialog Save Discover session, type Bookshelf errors (guides) in Title. Leave Store time with Discover session off and Add to dashboard on None.

  5. Click Save and add to library. The tab and the breadcrumbs now carry the name of the session.

    Discover with the save dialog open: the Save button of the top actions (callout 24), the Title field holding Bookshelf errors (guides) (callout 25) and the primary button that confirms the dialog (callout 26)

Check the result

The tab is called Bookshelf errors (guides) and the query box holds your last query (severity_text : "ERROR" if you typed it again for the save). The table shows the columns of step 17, and the histogram is stacked by severity_text. Open Discover → More → Open session to see the saved session in the list.

To see the chart react, make the service fail again, restore normal traffic after a minute, and press Refresh in the filter row:

curl -X POST localhost:8090/mode/failing
curl -X POST localhost:8090/mode/normal

The ERROR stack grows for the minute of the failure.

Variations

  • Click Share in the top actions to copy a link to the session. The link keeps the query and the filters; the option to use an absolute time range makes it show the same minutes for whoever opens it.

  • Click the Display options button of the table toolbar to change the density of the rows and how many lines a cell shows.

  • Query in ES|QL in the top actions switches the same screen to the piped query language, which the next guide introduces.

What can go wrong

Symptom Cause Fix

The histogram is empty and the table says that no results were found

The time picker covers a range without log records, or the data view is another one.

Choose Last 15 minutes or Last 24 hours, check the data view picker, and send curl -X POST localhost:8090/mode/normal if curl localhost:8090/ shows another mode.

A query is rejected with a syntax error

A quote is missing, or a value with spaces or special characters is not quoted.

Write text values in double quotes, as in the examples, and check that and and or are between two complete conditions.

The wildcard query finds nothing

The value was written in quotes, so the star was read as a plain character.

Write attributes.uri : /api/b* without quotes.

There is no ERROR stack in the chart

The failing traffic was never sent, or it is older than the time range.

Send the commands of Before you start again and press Refresh.

The columns do not appear in the table

The button was clicked on another field, or the field list was filtered by the search box.

Clear Search field names and click Add field as column on the right row.

The saved session does not keep the filters you expected

A filter was deleted or disabled before saving.

Enable the pills before you save, then use Save again.

Clean up

Keep the saved session Bookshelf errors (guides): a later guide shows it on a dashboard. Restore the service to normal traffic if you have not yet:

curl -X POST localhost:8090/mode/normal

To remove the session together with everything else the lab stores, stop the profile with docker compose --profile kibana down -v.

Where to go next