What's the differece between index pattern and index template

I am a little confused about index pattern in kibana and index template in the elasticsearch, could someone explain what is the difference between these two ? Should we load the index template first before creating index pattern in kibana?

Thanks!

1 Like

From Elasticsearch Documentation

An index is a collection of documents that have somewhat similar characteristics. For example, you can have an index for customer data, another index for a product catalog, and yet another index for order data. An index is identified by a name (that must be all lowercase) and this name is used to refer to the index when performing indexing, search, update, and delete operations against the documents in it.


From Elasticsearch Documentation

Index templates allow you to define templates that will automatically be
applied when new indices are created. The templates include both settings and
mappings, and a simple pattern template that controls whether the template
should be applied to the new index.


From Kibana Documentation

An index pattern identifies one or more Elasticsearch indices that you want to explore with Kibana. Kibana looks for
index names that match the specified pattern.
An asterisk (*) in the pattern matches zero or more characters. For example, the pattern myindex-* matches all
indices whose names start with myindex-, such as myindex-1 and myindex-2.An index pattern can also simply be the name of a single index.


In other words, Index and Index Template are Elasticsearch constructs. Index Pattern is a Kibana construct.

An Index is where the actual data is stored, and an Index Template gives Elasticsearch some rules about how to create indexes. All this pertains to how new data is stored.

Index Pattern is the construct that tells Kibana how to find data in indexes in Elasticsearch. This pertains to how existing data is accessed (In the context of Kibana).

15 Likes

Thanks for detail explanation!