Step 2: Configuring Metricbeat

edit

To configure Metricbeat, you edit the configuration file. For rpm and deb, you’ll find the configuration file at /etc/metricbeat/metricbeat.yml. Under Docker, it’s located at /usr/share/metricbeat/metricbeat.yml. For mac and win, look in the archive that you just extracted. There’s also a full example configuration file called metricbeat.full.yml that shows all non-deprecated options.

See the Config File Format section of the Beats Platform Reference for more about the structure of the config file.

Metricbeat uses modules to collect metrics. You configure each module individually. The following example shows the default configuration in the metricbeat.yml file. The system status module is enabled by default to collect metrics about your server, such as CPU usage, memory usage, network IO metrics, and process statistics:

metricbeat.modules:
- module: system
  metricsets:
    - cpu
    - filesystem
    - memory
    - network
    - process
  enabled: true
  period: 10s
  processes: ['.*']
  cpu_ticks: false

The following example shows how to configure two modules: the system module and the Apache HTTPD module:

metricbeat.modules:
- module: system
  metricsets:
    - cpu
    - filesystem
    - memory
    - network
    - process
  enabled: true
  period: 10s
  processes: ['.*']
  cpu_ticks: false
- module: apache
  metricsets: ["status"]
  enabled: true
  period: 1s
  hosts: ["http://127.0.0.1"]

To configure Metricbeat:

  1. Define the Metricbeat modules that you want to enable. For each module, specify the metricsets that you want to collect. See Configuring Metricbeat for more details about configuring modules.

    If you accept the default configuration without specifying additional modules, Metricbeat will collect system metrics only.

  2. If you are sending output to Elasticsearch, set the IP address and port where Metricbeat can find the Elasticsearch installation:

    output.elasticsearch:
      hosts: ["192.168.1.42:9200"]

    If you are sending output to Logstash, see Configuring Metricbeat to use Logstash instead.