> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kibana Problem and Solution

> Explains how Kibana provides a web UI for querying Elasticsearch, visualizing logs, creating dashboards, and enabling team investigations instead of using raw curl and JSON

Reading raw JSON from curl is no way for a team to investigate issues efficiently.

Take Bob's cluster. It's Monday morning and support reports that USER1 had a rough weekend on the website. The raw JSON that Elasticsearch stores looks like this:

```json theme={null}
{"_source":{"log":"USER1 logged in"}}
```

Kibana has the data — but answering questions with curl is tedious. Bob must remember the search endpoint, construct a long URL, add a `size` parameter so results aren't truncated, and then scan a wall of JSON for timestamps.

```bash theme={null}
$ curl "localhost:30200/_search?q=log:USER1&size=500&pretty"
{
  "hits" : {
    "hits" : [
      {
        "_index" : "fluentd-2026.10.10",
        "_source" : {
          "log" : "USER1 logged in",
          "@timestamp" : "2026-10-10T02:14:07Z"
        }
      }
    ]
  }
}
```

A teammate leans over and asks, “Can you check USER3 too?” and the whole process repeats. Without meaning to, Bob has become the team’s search engine. That does not scale.

What the team needs is a UI that sits in front of Elasticsearch, accepts human-friendly queries, and shows answers as rows and charts instead of raw JSON. That tool is Kibana.

Kibana is a web application — a page in your browser that asks Elasticsearch questions on your behalf. Kibana does not store log documents itself; it queries Elasticsearch’s REST API and renders the results.

![A simple diagram titled "Just a Web Page" showing a user labeled Bob sending requests to Kibana which then forwards to Elasticsearch. A small mock browser panel at the bottom left shows search/log entries for "USER1" with timestamps.](https://mintcdn.com/kodekloud-c4ac6d9a/cyXgW82iESBZQIyk/images/Learn-By-Doing-Deploying-and-Managing-the-EFK-Stack-on-Kubernetes/Visualizing-Logs-With-Kibana/Kibana-Problem-and-Solution/bob-kibana-elasticsearch-webpage-diagram.jpg?fit=max\&auto=format\&n=cyXgW82iESBZQIyk\&q=85\&s=d54caff5308a0303acb50b8e35de2807)

Every search in Kibana results in an HTTP request to Elasticsearch (port 9200). Kibana simply formats the results and displays them in the browser.

Where does Kibana run inside the cluster? Because Kibana doesn’t hold log data, it does not require persistent storage or fixed network identity. If a Kibana pod crashes, Elasticsearch remains intact — a new Kibana pod can start and reconnect. For that reason, Kibana is commonly deployed as a Deployment (one replica is often sufficient), while Elasticsearch runs as a StatefulSet with persistent storage.

In this lab Bob’s deployment is named `kibana`, runs in the `elastic-stack` namespace, uses Kibana `7.1.0`, and listens on port `5601` (Kibana’s default).

![A stylized diagram titled "Bob's Kibana Deployment" showing a Kibana instance (kibana:7.1.0) inside an elastic-stack box with Port 5601 labeled.](https://mintcdn.com/kodekloud-c4ac6d9a/cyXgW82iESBZQIyk/images/Learn-By-Doing-Deploying-and-Managing-the-EFK-Stack-on-Kubernetes/Visualizing-Logs-With-Kibana/Kibana-Problem-and-Solution/bob-kibana-deployment-5601.jpg?fit=max\&auto=format\&n=cyXgW82iESBZQIyk\&q=85\&s=76393401a6fa980a2fad76a6b97afe0e)

A running Kibana pod is not automatically reachable from a browser outside the cluster. To expose it, Bob uses a Kubernetes Service. In the lab this is a NodePort Service, which opens a fixed port on each node and forwards traffic to port `5601` on the Kibana pod. Bob types the node’s address and the NodePort into his browser:

```text theme={null}
node01:30601
```

Now Kibana is available, but it still needs to know which logs to search. Elasticsearch contains many indices. Fluentd creates daily indices named with a prefix and the date (for example `fluentd-2026.10.12`), so you get new indices every day.

![A presentation slide titled "The Index Pattern" showing a Kibana icon with a "Which logs?" callout on the left. On the right is a cylindrical database icon labeled "fluentd-2026.10.12."](https://mintcdn.com/kodekloud-c4ac6d9a/cyXgW82iESBZQIyk/images/Learn-By-Doing-Deploying-and-Managing-the-EFK-Stack-on-Kubernetes/Visualizing-Logs-With-Kibana/Kibana-Problem-and-Solution/index-pattern-kibana-fluentd-20261012.jpg?fit=max\&auto=format\&n=cyXgW82iESBZQIyk\&q=85\&s=c734b6328d44743b75f376d0777e49f0)

Bob creates an index pattern so Kibana knows which indices to query. For example:

`fluentd-*`

He also configures the timestamp field so results can be sorted and filtered by time. That saved configuration is called an index pattern and it lets Kibana search across many time-based indices as a single logical dataset.

Create an index pattern (for example `fluentd-*`) and set the time field (usually `@timestamp`) so Discover, Visualize, and Dashboards can filter and sort logs by time.

With the index pattern saved, Bob opens Discover. Discover is a scrolling list of log documents (newest first), with a search bar on top and a time picker beside it. The search bar accepts KQL (Kibana Query Language), which is easier and more expressive than crafting raw Elasticsearch URLs.

Bob types `log:USER1`, presses Update, and Discover returns only USER1 events:

```text theme={null}
08:15:42  USER2 opened page
08:15:37  USER1 logged in
08:15:31  USER3 login failed
08:15:20  USER1 opened page
```

Change the query to `log:USER3` and the list updates instantly. What took minutes with curl now takes seconds, and anyone with access to the Kibana page can run the same query.

Discover is for reading individual lines, but Kibana can also convert searches into visualizations — e.g., a bar chart that counts occurrences of each user. Visualizations can be pinned to dashboards that teams keep open to monitor trends. Dashboards can be exported and imported as NDJSON files, making it easy to share saved dashboards.

![A dark-themed slide titled "Charts and Dashboards" with a large "Lines per User" bar chart for USER1–USER4 on the left. On the right is a four-panel dashboard of small bar charts and an "export.ndjson" file icon beneath.](https://mintcdn.com/kodekloud-c4ac6d9a/cyXgW82iESBZQIyk/images/Learn-By-Doing-Deploying-and-Managing-the-EFK-Stack-on-Kubernetes/Visualizing-Logs-With-Kibana/Kibana-Problem-and-Solution/charts-dashboards-lines-user-ndjson.jpg?fit=max\&auto=format\&n=cyXgW82iESBZQIyk\&q=85\&s=098773db98a821d179f381182925e896)

Security caveat: in this lab anyone who can reach the NodePort can view all logs because there is no authentication. That is acceptable for a private lab, but not for production. Protect Kibana using an authenticated reverse proxy, an Ingress with TLS and authentication, or Kibana’s built-in security features.

Exposing Kibana via a NodePort without authentication lets anyone who can reach the node port view and query all logs. Do not use an unauthenticated NodePort in production; instead use an authenticated reverse proxy, an Ingress with TLS and authentication, or Kibana's security features.

When should you use Kibana?

| Use case | Tool |
| - | - |
| Single-line lookups and scripts run by one person | curl / direct Elasticsearch API |
| Team investigations, ad-hoc searching, time-based analysis, visual dashboards | Kibana |
| Long-term storage, indexing, and cluster resilience | Elasticsearch (StatefulSet, persistent storage) |

If you are the only person reading logs and you always know the exact line to fetch, curl is fine. The moment a second person wants to ask their own question, or you need to spot patterns over time instead of fetching a single line, put Kibana in front of Elasticsearch.

Bob’s team crossed that line on Monday morning: the manual curl that once answered questions is now replaced by a shared, searchable, visual interface.

Links and References

* Kibana docs: [https://www.elastic.co/guide/en/kibana/current/index.html](https://www.elastic.co/guide/en/kibana/current/index.html)
* Kibana Query Language (KQL): [https://www.elastic.co/guide/en/kibana/current/kuery-query.html](https://www.elastic.co/guide/en/kibana/current/kuery-query.html)
* Kubernetes NodePort Service: [https://kubernetes.io/docs/concepts/services-networking/service/#nodeport](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport)
* NDJSON format: [https://ndjson.org](https://ndjson.org)
* Elasticsearch docs: [https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)

> [card] [Watch Video](https://learn.kodekloud.com/user/courses/learn-by-doing-deploying-and-managing-the-efk-stack-on-kubernetes/module/21f0666b-e535-4c89-b6a7-4a8d1f05f961/lesson/50573e0e-76d2-4edf-b376-cad78f46a5c4)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.