0
0
Microservicessystem_design~20 mins

Centralized logging (ELK stack) in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ELK Stack Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the role of Logstash in ELK stack

In the ELK stack, what is the primary role of Logstash?

AVisualize logs and create dashboards for monitoring
BStore and index logs for fast search and retrieval
CCollect, parse, and transform logs before sending them to Elasticsearch
DGenerate logs from microservices automatically
Attempts:
2 left
💡 Hint

Think about which component processes and prepares logs before storage.

💻 Command Output
intermediate
2:00remaining
Output of Elasticsearch index creation command

What is the expected output when you successfully create an index named 'logs-2024' in Elasticsearch using the following curl command?

curl -X PUT "localhost:9200/logs-2024" -H 'Content-Type: application/json'
A{"acknowledged":false,"index":"logs-2024"}
B{"error":"index_already_exists_exception","status":400}
Ccurl: (7) Failed to connect to localhost port 9200: Connection refused
D{"acknowledged":true,"shards_acknowledged":true,"index":"logs-2024"}
Attempts:
2 left
💡 Hint

Successful index creation returns an acknowledgment with true values.

Configuration
advanced
2:30remaining
Correct Logstash input configuration for Docker logs

Which Logstash input configuration correctly reads Docker container logs from the default JSON file location?

A
input {
  file {
    path => "/var/log/docker.log"
    codec => plain
  }
}
B
input {
  file {
    path => "/var/lib/docker/containers/*/*.log"
    codec => json
  }
}
C
input {
  tcp {
    port => 5044
  }
}
D
input {
  beats {
    port => 5044
  }
}
Attempts:
2 left
💡 Hint

Docker stores container logs as JSON files in a specific directory.

Troubleshoot
advanced
2:00remaining
Diagnosing Kibana dashboard not showing logs

You have set up ELK stack and Logstash is running. However, Kibana dashboards show no logs. Which of the following is the most likely cause?

AElasticsearch index pattern is not configured in Kibana
BLogstash service is stopped
CDocker containers are not running
DKibana is running on the wrong port
Attempts:
2 left
💡 Hint

Kibana needs to know which Elasticsearch indexes to read from.

🔀 Workflow
expert
3:00remaining
Order of ELK stack components in log processing pipeline

Arrange the ELK stack components in the correct order of processing logs from collection to visualization.

A4,3,1,2
B3,4,1,2
C4,1,3,2
D3,1,4,2
Attempts:
2 left
💡 Hint

Think about which component collects logs first and which shows them last.