0
0
Elasticsearchquery~20 mins

Ingest pipelines in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Ingest Pipeline Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this ingest pipeline simulation?
Given the following ingest pipeline configuration and a document, what will be the value of the full_name field after processing?
Elasticsearch
{
  "description": "Combine first and last name",
  "processors": [
    {
      "set": {
        "field": "full_name",
        "value": "{{first_name}} {{last_name}}"
      }
    }
  ]
}

Document:
{
  "first_name": "Alice",
  "last_name": "Johnson"
}
A"full_name" will be "Alice"
B"full_name" will be "{{first_name}} {{last_name}}" (literal string)
CThe pipeline will fail with a template error
D"full_name" will be "Alice Johnson"
Attempts:
2 left
💡 Hint
Remember that double curly braces {{}} are used for variable substitution in ingest pipelines.
Predict Output
intermediate
2:00remaining
What is the output of this pipeline with a grok processor?
Given this ingest pipeline and input document, what will be the value of the status_code field after processing?
Elasticsearch
{
  "description": "Extract status code from message",
  "processors": [
    {
      "grok": {
        "field": "message",
        "patterns": ["%{WORD:method} %{URIPATHPARAM:request} %{NUMBER:status_code:int}"]
      }
    }
  ]
}

Document:
{
  "message": "GET /home 404"
}
A404 (as an integer)
B"404" (as a string)
Cnull (field not extracted)
DPipeline fails with grok parse error
Attempts:
2 left
💡 Hint
The grok pattern uses :int to convert the extracted value to integer.
🔧 Debug
advanced
2:00remaining
Why does this pipeline fail with a 'field not found' error?
This ingest pipeline uses a rename processor but fails with an error. What is the cause?
Elasticsearch
{
  "description": "Rename field",
  "processors": [
    {
      "rename": {
        "field": "user",
        "target_field": "username"
      }
    }
  ]
}

Document:
{
  "username": "bob123"
}
AThe rename processor requires a 'copy' flag to be set to true.
BThe source field 'user' does not exist in the document, causing the error.
CThe pipeline syntax is invalid because 'field' and 'target_field' are swapped.
DThe target field 'username' already exists, causing a conflict error.
Attempts:
2 left
💡 Hint
Check if the source field exists in the input document.
📝 Syntax
advanced
2:00remaining
Which option shows a valid ingest pipeline with a conditional processor?
Select the pipeline JSON that correctly uses a condition to run a processor only if the field status equals error.
A
{
  "processors": [
    {
      "set": {
        "field": "alert",
        "value": "true",
        "if": "ctx.status == 'error'"
      }
    }
  ]
}
B
{
  "processors": [
    {
      "set": {
        "field": "alert",
        "value": "true",
        "condition": "ctx.status == 'error'"
      }
    }
  ]
}
C
{
  "processors": [
    {
      "set": {
        "field": "alert",
        "value": "true"
      },
      "if": "ctx.status == 'error'"
    }
  ]
}
D
{
  "processors": [
    {
      "set": {
        "field": "alert",
        "value": "true"
      },
      "condition": "ctx.status == 'error'"
    }
  ]
}
Attempts:
2 left
💡 Hint
The condition must be outside the processor object, not inside the processor's parameters.
🚀 Application
expert
2:00remaining
How many processors run for this document in the pipeline?
Consider this pipeline with two processors and a condition on the second. How many processors will run when processing the document below?
Elasticsearch
{
  "processors": [
    {
      "set": {
        "field": "processed",
        "value": true
      }
    },
    {
      "remove": {
        "field": "debug"
      },
      "if": "ctx.debug == false"
    }
  ]
}

Document:
{
  "debug": true
}
AOnly 1 processor runs (the set processor).
BBoth processors run.
CNo processors run because condition fails.
DOnly the remove processor runs.
Attempts:
2 left
💡 Hint
Check the condition on the remove processor and the value of the debug field.