0
0
Elasticsearchquery~10 mins

Template priority and composition in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a template with the highest priority.

Elasticsearch
{
  "index_patterns": ["log-*"],
  "priority": [1],
  "template": {
    "settings": {
      "number_of_shards": 1
    }
  }
}
Drag options to blanks, or click blank then click option'
A0
B500
C-1
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or negative numbers which give lower priority.
Confusing priority with version number.
2fill in blank
medium

Complete the code to compose two templates using the 'composed_of' field.

Elasticsearch
{
  "index_patterns": ["app-*"],
  "composed_of": ["[1]", "base_template"],
  "template": {
    "settings": {
      "number_of_replicas": 2
    }
  }
}
Drag options to blanks, or click blank then click option'
Acustom_template
Bpriority_template
Clog_template
Ddefault_template
Attempts:
3 left
💡 Hint
Common Mistakes
Using a template name that does not exist.
Confusing 'composed_of' with 'index_patterns'.
3fill in blank
hard

Fix the error in the template priority assignment.

Elasticsearch
{
  "index_patterns": ["metrics-*"],
  "priority": [1],
  "template": {
    "mappings": {
      "properties": {
        "timestamp": { "type": "date" }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A10
Btrue
Cnull
D"high"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like "high" instead of a number.
Using null or boolean values.
4fill in blank
hard

Fill both blanks to create a composed template with correct priority and index pattern.

Elasticsearch
{
  "index_patterns": ["[1]"],
  "priority": [2],
  "composed_of": ["base_settings"],
  "template": {
    "settings": {
      "refresh_interval": "1s"
    }
  }
}
Drag options to blanks, or click blank then click option'
Alogs-*
B100
Cmetrics-*
D50
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing index patterns and priority values.
Using a low priority number that doesn't override others.
5fill in blank
hard

Fill all three blanks to define a template with index pattern, priority, and composed templates.

Elasticsearch
{
  "index_patterns": ["[1]"],
  "priority": [2],
  "composed_of": ["[3]", "common_settings"],
  "template": {
    "mappings": {
      "properties": {
        "user": { "type": "keyword" }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Auser-*
B75
Cuser_template
Dlogs-*
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated index patterns.
Setting priority too low or too high.
Using a non-existent template name in 'composed_of'.