Challenge - 5 Problems
Template Mastery in Elasticsearch
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why use index templates in Elasticsearch?
Which of the following best explains why index templates are used to standardize index creation in Elasticsearch?
Attempts:
2 left
💡 Hint
Think about how templates help keep index structure consistent.
✗ Incorrect
Index templates ensure that every new index matching a pattern has the same settings and mappings, which keeps data organized and queries reliable.
❓ query_result
intermediate2:00remaining
Result of applying an index template
Given an index template that sets the number_of_shards to 3 for indices starting with 'logs-', what will be the number_of_shards for a new index named 'logs-2024-06'?
Attempts:
2 left
💡 Hint
Templates override default shard settings for matching indices.
✗ Incorrect
The template applies the number_of_shards setting to all indices matching 'logs-*', so 'logs-2024-06' will have 3 shards.
📝 Syntax
advanced2:00remaining
Identify the correct JSON snippet for an index template
Which JSON snippet correctly defines an index template that applies to indices starting with 'app-' and sets the refresh_interval to '30s'?
Attempts:
2 left
💡 Hint
Look for correct keys and value types in the JSON.
✗ Incorrect
The correct key is 'index_patterns' with an array of patterns, and 'settings' contains the refresh_interval as a string.
❓ optimization
advanced2:00remaining
Optimizing index template usage for multiple similar indices
You have multiple indices for different regions like 'sales-us', 'sales-eu', and 'sales-asia'. How can you optimize index template usage to standardize their creation?
Attempts:
2 left
💡 Hint
Think about how to reduce repetition and ensure consistency.
✗ Incorrect
A single template with a pattern matching all sales indices ensures consistent settings and reduces maintenance.
🔧 Debug
expert2:00remaining
Why does an index not inherit template settings?
You created an index template with pattern 'data-*' setting number_of_replicas to 2. However, a new index named 'data-2024' has number_of_replicas set to 1. What is the most likely reason?
Attempts:
2 left
💡 Hint
Consider when templates are applied during index lifecycle.
✗ Incorrect
Templates apply only when an index is created. If the index existed before the template, it won't inherit those settings.