0
0
ElasticsearchHow-ToBeginner · 3 min read

How to Create Index Pattern in Kibana: Step-by-Step Guide

To create an index pattern in Kibana, go to the Stack Management section, select Index Patterns, then click Create index pattern. Enter the name of your Elasticsearch index or use a wildcard like logs-*, and follow the prompts to complete the setup.
📐

Syntax

Creating an index pattern in Kibana involves specifying the pattern that matches your Elasticsearch indices. This pattern tells Kibana which data to use for visualizations and dashboards.

  • Index pattern name: The name or wildcard pattern matching your Elasticsearch indices (e.g., logstash-*).
  • Time field: Optional field to filter data by time (usually a timestamp).
  • Create: Button to finalize the index pattern creation.
plaintext
1. Open Kibana UI
2. Navigate to Stack Management > Index Patterns
3. Click 'Create index pattern'
4. Enter index pattern name (e.g., 'logstash-*')
5. Select time field (optional)
6. Click 'Create index pattern'
💻

Example

This example shows how to create an index pattern for logs stored in Elasticsearch with indices named like logs-2024.06.01, logs-2024.06.02, etc.

plaintext
1. Open Kibana in your browser.
2. Click on 'Stack Management' in the left menu.
3. Select 'Index Patterns'.
4. Click 'Create index pattern'.
5. In the 'Index pattern name' box, type 'logs-*'.
6. Click 'Next step'.
7. Choose '@timestamp' as the time filter field.
8. Click 'Create index pattern'.
Output
Index pattern 'logs-*' created successfully and ready to use in Kibana visualizations.
⚠️

Common Pitfalls

Some common mistakes when creating index patterns in Kibana include:

  • Using an incorrect or misspelled index pattern name that does not match any Elasticsearch indices.
  • Not selecting a time field when your data has timestamps, which limits time-based filtering.
  • Trying to create an index pattern before Elasticsearch indices exist, resulting in no matches.

Always verify your Elasticsearch indices exist and match the pattern before creating it in Kibana.

plaintext
Wrong:
- Entering 'log-*' when your indices are named 'logs-*'
Right:
- Entering 'logs-*' to match your indices

Wrong:
- Skipping time field selection when data has timestamps
Right:
- Selecting '@timestamp' or the correct time field
📊

Quick Reference

StepActionNotes
1Go to Stack Management > Index PatternsAccess index pattern settings in Kibana
2Click 'Create index pattern'Start creating a new pattern
3Enter index pattern nameUse exact name or wildcard (e.g., 'logs-*')
4Select time field (optional)Choose timestamp field for time filtering
5Click 'Create index pattern'Finalize and save the pattern

Key Takeaways

Create index patterns in Kibana under Stack Management > Index Patterns.
Use wildcards like '*' to match multiple Elasticsearch indices.
Select a time field to enable time-based filtering in visualizations.
Ensure your Elasticsearch indices exist and match the pattern before creating it.
Double-check spelling and pattern syntax to avoid no matches.