Complete the code to define a template with the highest priority.
{
"index_patterns": ["log-*"],
"priority": [1],
"template": {
"settings": {
"number_of_shards": 1
}
}
}The highest priority is set with a larger number. 1000 ensures this template overrides others with lower priority.
Complete the code to compose two templates using the 'composed_of' field.
{
"index_patterns": ["app-*"],
"composed_of": ["[1]", "base_template"],
"template": {
"settings": {
"number_of_replicas": 2
}
}
}The 'composed_of' field lists templates to combine. 'custom_template' is the correct name to compose with 'base_template'.
Fix the error in the template priority assignment.
{
"index_patterns": ["metrics-*"],
"priority": [1],
"template": {
"mappings": {
"properties": {
"timestamp": { "type": "date" }
}
}
}
}Priority must be a number. Using 10 sets a valid priority. Strings or booleans cause errors.
Fill both blanks to create a composed template with correct priority and index pattern.
{
"index_patterns": ["[1]"],
"priority": [2],
"composed_of": ["base_settings"],
"template": {
"settings": {
"refresh_interval": "1s"
}
}
}The index pattern 'logs-*' matches log indices, and priority 100 sets a higher precedence.
Fill all three blanks to define a template with index pattern, priority, and composed templates.
{
"index_patterns": ["[1]"],
"priority": [2],
"composed_of": ["[3]", "common_settings"],
"template": {
"mappings": {
"properties": {
"user": { "type": "keyword" }
}
}
}
}The index pattern 'user-*' matches user data indices, priority 75 sets moderate precedence, and 'user_template' is composed with 'common_settings'.