Ready to get going? Start your 14 days free trial today

Start free trial

Have an account? Sign in

Send data via Metricbeat to your Logstash instance provided by Logit.io

Metricbeat Configuration

Ship Metrics with Metricbeat to Logstash

Metricbeat is an open-source shipping agent used to collect and ship operating system and service metrics to one or more destinations, including Logstash.

Step 1 - Install MetricbeatCopy

deb (Debian/Ubuntu/Mint)

curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-oss-7.8.1-amd64.deb
sudo dpkg -i metricbeat-oss-7.8.1-amd64.deb

rpm (CentOS/RHEL/Fedora)

curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-oss-7.8.1-x86_64.rpm
sudo rpm -vi metricbeat-oss-7.8.1-x86_64.rpm

macOS

curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-oss-7.8.1-darwin-x86_64.tar.gz
tar xzvf metricbeat-oss-7.8.1-darwin-x86_64.tar.gz

Windows

  • Download the metricbeat Windows zip file from the official downloads page.
  • Extract the contents of the zip file into C:\Program Files.
  • Rename the metricbeat-<version>-windows directory to metricbeat.
  • Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.
  • Run the following commands to install metricbeat as a Windows service:
cd 'C:\Program Files\metricbeat'
.\install-service-metricbeat.ps1
If script execution is disabled on your system, you need to set the execution policy for the current session to allow the script to run. For example: PowerShell.exe -ExecutionPolicy UnRestricted -File .\install-service-metricbeat.ps1.
My OS isn't here! Don't see your system? Check out the official downloads page for more options (including 32-bit versions).

Step 2 - Locate the configuration fileCopy

deb/rpm /etc/metricbeat/metricbeat.yml
mac/win <EXTRACTED_ARCHIVE>/metricbeat.yml

Step 3 - Configure the ModulesCopy

Setup the data you wish to send us, by editing the modules. Examples of these settings are found in metricbeat.reference.yml, in the same folder as the configuration 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
There's also a large range of modules to collect metrics see here.

Step 4 - Configure outputCopy

We'll be shipping to Logstash so that we have the option to run filters before the data is indexed.
Comment out the elasticsearch output block.

## Comment out elasticsearch output
#output.elasticsearch:
#  hosts: ["localhost:9200"]

Uncomment and change the logstash output to match below.

output.logstash:
    hosts: ["your-logstash-host:your-ssl-port"]
    loadbalance: true
    ssl.enabled: true

Step 5 - Validate configurationCopy

Let's check the configuration file is syntactically correct by running metricbeat directly inside the terminal. If the file is invalid, metricbeat will print an error loading config file error message with details on how to correct the problem.

deb/rpm

sudo metricbeat -e -c /etc/metricbeat/metricbeat.yml

macOS

cd <EXTRACTED_ARCHIVE>
./metricbeat -e -c metricbeat.yml

Windows

cd <EXTRACTED_ARCHIVE>
.\metricbeat.exe -e -c metricbeat.yml

Step 6 - Start metricbeatCopy

Ok, time to start ingesting data!

deb/rpm

sudo systemctl enable metricbeat
sudo systemctl start metricbeat

mac

./metricbeat

Windows

Start-Service metricbeat

Step 7 - Metricbeat OverviewCopy

Metricbeat is a lightweight metrics shipper built using the Libbeat framework. It’s origins started from the now deprecated Topbeat & it is used for collecting service and system log metrics to be parsed in Logstash and used across the rest of the ELK Stack.

Metricbeat makes sending data for server monitoring simpler by aggregating system metrics from a number of popular tools including NGINX, MySQL, Apache & HAProxy. While Metricbeat can push log data directly to the Elastic Stack some users may wish to use a buffering service such as Redis or Kafka. Metricbeat does much more than simply collect metrics as it can be used to tap into a variety of systems and execute a range of enhancements to the log file before shipping the metrics to ELK

The shipper when paired with Kibana can be used to report on CPU, memory and load metrics. When used in a containerised environment with Docker it can be used as a solution for container monitoring on the Logit platform.

Our platform provides a complete hosted ELK solution allowing you to get the best out of Metricbeat in a single centralised platform for log and metric analysis. We believe that monitoring metrics plays a crucial role in maintaining the health & security of your applications

Discover more about our Metrics-As-A-Service Solution.

If you need any further assistance with sending data through Metricbeat to Logstash we're here to help. Feel free to reach out by contacting our support team via live chat & we'll be happy to assist.

Toggle View

Expand View

Return to Search