Bird
Raised Fist0
Elasticsearchquery~10 mins

Beats (Filebeat, Metricbeat) in Elasticsearch - Interactive Code Practice

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

Complete the code to specify the input type for Filebeat.

Elasticsearch
filebeat.inputs:
- type: [1]
Drag options to blanks, or click blank then click option'
Ametric
Bdatabase
Chttp
Dlog
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'metric' instead of 'log' for Filebeat input type.
2fill in blank
medium

Complete the code to enable Metricbeat system module.

Elasticsearch
metricbeat.modules:
- module: system
  [1]: true
Drag options to blanks, or click blank then click option'
Aenabled
Bactive
Cstart
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'active' or 'start' instead of 'enabled'.
3fill in blank
hard

Fix the error in the Filebeat output configuration to send data to Elasticsearch.

Elasticsearch
output.elasticsearch:
  hosts: ["[1]"]
Drag options to blanks, or click blank then click option'
Alocalhost:9200
B127.0.0.1:5601
Clocalhost:8080
D127.0.0.1:5044
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong port like 8080 or 5601 which are for other services.
4fill in blank
hard

Fill both blanks to configure Filebeat to read logs from /var/log and exclude .gz files.

Elasticsearch
filebeat.inputs:
- type: log
  paths:
    - [1]
  exclude_files: [[2]]
Drag options to blanks, or click blank then click option'
A"/var/log/*.log"
B"/var/log/*.gz"
C"/var/log/*.txt"
D"/var/log/*.json"
Attempts:
3 left
💡 Hint
Common Mistakes
Including .gz files instead of excluding them.
5fill in blank
hard

Fill all three blanks to create a Metricbeat configuration that collects CPU metrics every 10 seconds and sends to Elasticsearch at localhost:9200.

Elasticsearch
metricbeat.modules:
- module: system
  metricsets: [[1]]
  period: [2]
output.elasticsearch:
  hosts: ["[3]"]
Drag options to blanks, or click blank then click option'
A"cpu"
B"10s"
Clocalhost:9200
D"memory"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong metricsets like 'memory' instead of 'cpu'.
Setting period to wrong format or value.
Using wrong Elasticsearch host or port.

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