Bird
Raised Fist0
Elasticsearchquery~20 mins

Beats (Filebeat, Metricbeat) in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Beats Mastery
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 Filebeat configuration snippet?
Given this Filebeat input configuration, what will Filebeat do when started?
Elasticsearch
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /var/log/syslog
  multiline.pattern: '^\['
  multiline.negate: true
  multiline.match: after
AFilebeat reads /var/log/syslog and combines lines not starting with '[' into the previous line
BFilebeat reads /var/log/syslog and combines lines starting with '[' into the previous line
CFilebeat reads /var/log/syslog but does not combine any lines because multiline is disabled
DFilebeat reads /var/log/syslog and combines all lines into a single event
Attempts:
2 left
💡 Hint
Look at multiline.negate and multiline.match values carefully.
❓ Predict Output
intermediate
2:00remaining
What metric does Metricbeat collect with this module config?
Given this Metricbeat module configuration, what metric will be collected?
Elasticsearch
metricbeat.modules:
- module: system
  metricsets:
    - cpu
    - memory
  period: 10s
  enabled: true
ACPU and memory usage metrics every 10 seconds
BOnly CPU usage metrics every 10 seconds
COnly memory usage metrics every 10 seconds
DDisk usage metrics every 10 seconds
Attempts:
2 left
💡 Hint
Check the metricsets list carefully.
🔧 Debug
advanced
2:00remaining
Why does Filebeat fail to start with this config?
This Filebeat config snippet causes Filebeat to fail on startup. What is the cause?
Elasticsearch
filebeat.inputs:
- type: log
  enabled: true
  paths: /var/log/*.log
output.elasticsearch:
  hosts: ["localhost:9200"]
Aenabled must be false to start Filebeat
Bpaths should be a list, not a string
Coutput.elasticsearch hosts must be a string, not a list
Dtype: log is invalid, should be type: file
Attempts:
2 left
💡 Hint
Check the YAML syntax for paths.
❓ Predict Output
advanced
2:00remaining
What is the output of this Metricbeat processor configuration?
Given this Metricbeat config snippet, what will be the value of the 'host.name' field in the event?
Elasticsearch
processors:
- add_host_metadata:
    netinfo.enabled: false
- add_cloud_metadata:
- add_fields:
    target: host
    fields:
      name: custom-hostname
AThe cloud provider hostname
BThe system hostname from the OS
CAn empty string
D"custom-hostname"
Attempts:
2 left
💡 Hint
Look at the add_fields processor target and fields.
🧠 Conceptual
expert
2:00remaining
Which option best describes the role of Filebeat and Metricbeat in the Elastic Stack?
Choose the most accurate description of Filebeat and Metricbeat roles.
ABoth Filebeat and Metricbeat collect logs but from different sources
BFilebeat collects metrics; Metricbeat collects logs
CFilebeat collects and ships log files; Metricbeat collects and ships system and service metrics
DFilebeat and Metricbeat are used to store data in Elasticsearch
Attempts:
2 left
💡 Hint
Think about what logs and metrics mean.

Practice

(1/5)
1. What is the primary purpose of Filebeat in the Elastic Stack?
easy
A. To visualize data in dashboards
B. To collect system metrics like CPU and memory usage
C. To collect and ship log files from servers
D. To store data in Elasticsearch

Solution

  1. Step 1: Understand Filebeat's role

    Filebeat is designed to collect log files from servers and forward them.
  2. Step 2: Differentiate from Metricbeat

    Metricbeat collects system metrics, not logs.
  3. Final Answer:

    To collect and ship log files from servers -> Option C
  4. Quick Check:

    Filebeat = log collection [OK]
Hint: Filebeat = logs, Metricbeat = metrics [OK]
Common Mistakes:
  • Confusing Filebeat with Metricbeat
  • Thinking Filebeat visualizes data
  • Assuming Filebeat stores data
2. Which of the following is the correct syntax to start Filebeat on a Linux system?
easy
A. sudo systemctl start filebeat
B. filebeat run start
C. start filebeat service
D. service filebeat enable

Solution

  1. Step 1: Identify standard Linux service start command

    On modern Linux systems, services are started with 'sudo systemctl start servicename'.
  2. Step 2: Match with Filebeat service

    Filebeat service is named 'filebeat', so the command is 'sudo systemctl start filebeat'.
  3. Final Answer:

    sudo systemctl start filebeat -> Option A
  4. Quick Check:

    systemctl start filebeat = correct syntax [OK]
Hint: Use systemctl to manage services on Linux [OK]
Common Mistakes:
  • Using incorrect command order
  • Confusing 'start' with 'enable'
  • Using non-standard service commands
3. Given this Filebeat configuration snippet:
filebeat.inputs:
- type: log
  paths:
    - /var/log/syslog
output.elasticsearch:
  hosts: ["localhost:9200"]

What will Filebeat do when started?
medium
A. Store logs locally without sending
B. Collect system metrics and send to Elasticsearch
C. Send logs to a remote Logstash server
D. Collect logs from /var/log/syslog and send to Elasticsearch at localhost:9200

Solution

  1. Step 1: Analyze input configuration

    The input type is 'log' and path is '/var/log/syslog', so Filebeat collects logs from this file.
  2. Step 2: Analyze output configuration

    Output is set to Elasticsearch at 'localhost:9200', so logs are sent there.
  3. Final Answer:

    Collect logs from /var/log/syslog and send to Elasticsearch at localhost:9200 -> Option D
  4. Quick Check:

    Input logs + output Elasticsearch = Collect logs from /var/log/syslog and send to Elasticsearch at localhost:9200 [OK]
Hint: Check input type and output host to predict behavior [OK]
Common Mistakes:
  • Confusing logs with metrics
  • Assuming output is Logstash
  • Ignoring the paths setting
4. You configured Metricbeat to collect CPU metrics but see no data in Elasticsearch. Which of these is a likely cause?
medium
A. Metricbeat service is not running
B. Filebeat is collecting logs instead of metrics
C. Elasticsearch is not installed
D. Metricbeat configuration file is empty

Solution

  1. Step 1: Check Metricbeat service status

    If Metricbeat is not running, it cannot collect or send metrics.
  2. Step 2: Consider other options

    Filebeat collecting logs is unrelated; Elasticsearch not installed would cause errors; empty config would cause no collection.
  3. Final Answer:

    Metricbeat service is not running -> Option A
  4. Quick Check:

    Service running = data sent [OK]
Hint: Always verify Metricbeat service is active [OK]
Common Mistakes:
  • Mixing Filebeat and Metricbeat roles
  • Ignoring service status
  • Assuming Elasticsearch absence without error
5. You want to monitor both system logs and CPU metrics on a server using Beats. Which setup is best?
hard
A. Run Filebeat and Metricbeat but send data to different Elasticsearch clusters
B. Run Filebeat for logs and Metricbeat for CPU metrics, both sending to Elasticsearch
C. Run Metricbeat for logs and Filebeat for metrics
D. Run only Filebeat configured for logs and metrics

Solution

  1. Step 1: Identify Beats roles

    Filebeat collects logs; Metricbeat collects system metrics like CPU.
  2. Step 2: Choose correct combination

    Running both Beats with their proper roles and sending data to the same Elasticsearch cluster is best for unified monitoring.
  3. Final Answer:

    Run Filebeat for logs and Metricbeat for CPU metrics, both sending to Elasticsearch -> Option B
  4. Quick Check:

    Filebeat = logs + Metricbeat = metrics [OK]
Hint: Use Filebeat for logs and Metricbeat for metrics together [OK]
Common Mistakes:
  • Mixing roles of Filebeat and Metricbeat
  • Sending data to separate clusters unnecessarily
  • Assuming one Beat can do both well
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard