0
0
Elasticsearchquery~10 mins

Why data pipelines feed Elasticsearch - Test Your Understanding

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

Complete the code to insert a document into Elasticsearch.

Elasticsearch
POST /my_index/_doc/[1]
{
  "user": "alice",
  "message": "Hello Elasticsearch"
}
Drag options to blanks, or click blank then click option'
A1
Bindex
Csearch
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using operation names like 'index' or 'search' instead of a document ID.
2fill in blank
medium

Complete the code to query documents containing the word 'error'.

Elasticsearch
GET /logs/_search
{
  "query": {
    "match": {
      "message": "[1]"
    }
  }
}
Drag options to blanks, or click blank then click option'
Awarning
Bdebug
Cinfo
Derror
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing unrelated keywords like 'info' or 'debug'.
3fill in blank
hard

Fix the error in the pipeline configuration to send data to Elasticsearch.

Elasticsearch
output {
  elasticsearch {
    hosts => ["[1]"]
    index => "logs-%{+YYYY.MM.dd}"
  }
}
Drag options to blanks, or click blank then click option'
A9200
Bhttp://localhost:9200
Clocalhost:9200
Dhttp://localhost
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting 'http://' or the port number.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.

Elasticsearch
{word: [1] for word in words if [2]
Drag options to blanks, or click blank then click option'
Alen(word)
Blen(word) > 3
Cword.startswith('a')
Dword == 'test'
Attempts:
3 left
💡 Hint
Common Mistakes
Using conditions unrelated to length or wrong expressions in the value part.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary from data where keys are uppercase and values are positive.

Elasticsearch
{ [1]: [2] for [3], v in data.items() if v > 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names or not uppercasing keys.