0
0
Elasticsearchquery~20 mins

Logstash overview in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Logstash Mastery Badge
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 Logstash filter configuration?

Given the following Logstash filter configuration, what will be the value of the message field after processing?

Elasticsearch
filter {
  mutate {
    add_field => { "message" => "Hello" }
  }
  mutate {
    update => { "message" => "%{message} World" }
  }
}
A"Hello World"
B"Hello"
C"%{message} World"
D"World"
Attempts:
2 left
💡 Hint

Remember that update replaces the field value and supports field references.

🧠 Conceptual
intermediate
1:30remaining
Which Logstash plugin type is responsible for sending data to Elasticsearch?

In Logstash, which plugin type is used to send processed data to Elasticsearch?

Afilter
Binput
Coutput
Dcodec
Attempts:
2 left
💡 Hint

Think about the plugin that handles where data goes after processing.

Predict Output
advanced
2:00remaining
What error does this Logstash configuration produce?

Consider this Logstash filter snippet. What error will Logstash raise when processing?

Elasticsearch
filter {
  if [nonexistent_field] == "value" {
    mutate {
      add_field => { "new_field" => "test" }
    }
  }
}
AConfigurationError: mutate plugin missing required parameter
BSyntaxError: unexpected token 'if'
CRuntimeError: field [nonexistent_field] not found
DNo error, condition evaluates to false and filter skips
Attempts:
2 left
💡 Hint

Logstash conditions on missing fields usually do not cause errors.

🚀 Application
advanced
2:00remaining
How many events will be generated by this Logstash configuration?

Given this Logstash filter configuration, how many events will be output for one input event?

Elasticsearch
filter {
  split {
    field => "tags"
  }
}
AOne event per tag in the tags field
BNo events, split filter drops events
CTwo events always
DOne event total, tags remain as an array
Attempts:
2 left
💡 Hint

The split filter creates one event per element in the specified field array.

🔧 Debug
expert
3:00remaining
Why does this Logstash pipeline fail to start?

Examine this Logstash pipeline configuration snippet. Why will Logstash fail to start?

Elasticsearch
input {
  stdin {}
}
filter {
  mutate {
    add_field => { "field1" => "value1" }
  }
}
output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "myindex"
    user => "elastic"
  }
}
AInvalid host URL format in Elasticsearch output
BMissing password for Elasticsearch output user causes startup failure
CSyntax error in mutate plugin configuration
Dstdin input plugin is not supported
Attempts:
2 left
💡 Hint

Check required authentication parameters for Elasticsearch output plugin.