How to join two Indices in Kibana

woman coding on computer
Reading Time: 3 minutes

Hello Readers! We are again back with a new interesting topic related to kibana. In this blog, we will see how to join two indices in kibana. As we all know Kibana is an open-source data visualization and exploration tool developed by Elastic. It is part of the Elastic Stack, which also includes Elasticsearch and Logstash. Kibana is design to work with Elasticsearch and allows users to visualize and analyze large amounts of data stored in Elasticsearch indices.

Indices in Kibana:

An index is equivalent to a table in a relational database. Each document in an index represents a data record, and the fields within each document represent the columns of the table.

An index is stored in Elasticsearch, which is a distributed search and analytics engine. When you index data into Elasticsearch, you can then use Kibana to visualize, explore, and analyze that data. Kibana provides several features for working with indices, including the ability to create, update, and delete indices, define index patterns, and search and filter data within indices.

why join two indices in kibana?

Joining two indices in Kibana can be useful in several situations:

  1. Combining data from multiple sources: Joining two indices allows you to combine data from different sources into a single view. This can be useful when you want to analyze data from different indices and gain insights into relationships between the data.
  1. Creating composite documents: Joining two indices enables you to create composite documents that contain information from both indices. This can be useful when you want to combine data from two indices into a single document for analysis or reporting purposes.
  1. Improving performance: Joining two indices in Kibana can improve performance by reducing the amount of data that needs to be processed. This is because only the relevant data is returned, rather than having to retrieve and process all of the data from both indices.
  1. Simplifying complex data relationships: Joining two indices can help simplify complex data relationships by combining relevant information into a single, easy-to-understand view.

By joining two indices in Kibana, you can gain a better understanding of your data, make more informed decisions, and achieve a more complete picture of your data.

Steps for joining two indices in Kibana:

In Kibana, you can join two indices by performing a query in dev tools. Here is a general process for joining two indices:

Step 1: For joining two indices you must have the two indices already created that you want to join. So my first index is github _commit and my second index is github_pr. When I will join these two index it will create a new index itself.

Step 2: Open your dev tool and perform the following query.:

POST /_aliases


  "actions": [{"add": {"index": "index_1","alias": "new_index_alias"}},

              {"add": {"index": "index_2","alias": "new_index_alias"}}



In this example, index_1 and index_2 are the two indices you want to join, and new_index_alias is the new index name that will be created after joining these two indices.


The response will be like this:


Step 3: Move to stack management > Index pattern. Click on create index pattern. You will be able to see a new index already created there. Select that index and timefield and create an index pattern.


Step 4: Now we are all set to visualize this index. Explore it according to your use cases.



Thank you for sticking to the end. In this blog, we have learned how to join two indices in kibana. This is really very useful and simple. I hope this blog helped you somewhere. Please share if you liked this blog. Kindly reach out to me for any related queries.


Written by 

Naincy Kumari is a DevOps Consultant at Knoldus Inc. She is always ready to learn new technologies and tools. She loves painting and dancing.