Skip to main content

Beats: Metricbeat

Coralogix integrates with Metricbeat so you can send your metric data from anywhere and create metric dashboards.

What you need​

  • Have Metricbeat installed. For more information on how to install it, see the Elastic documentation.

  • A Logstash instance that you run in your own infrastructure, configured to receive Beats input and forward it to Coralogix. Coralogix no longer hosts a Logstash server for Beats shippers. See Run your own Logstash instance for the Logstash input, filter, and output configuration.

General​

Private Key: Your Send-Your-Data API key is a unique ID that represents your company.

Application Name: The name of your main application, for example, a company named "SuperData" would probably insert the "SuperData" string parameter or if they want to debug their test environment they might insert the "SuperData - Test".

SubSystem Name: Your application probably has multiple subsystems, for example: Backend servers, Middleware, Frontend servers etc. in order to help you examine the data you need, inserting the subsystem parameter is vital.

Configuration​

On the host machine​

Open your Metricbeat configuration file and configure it to use Logstash. For more information about configuring Metricbeat to use Logstash, see the Elastic documentation.

Point your Metricbeat to output to your own Logstash instance:

<logstash-ip-address>:5044
Note

The Coralogix-hosted Logstash endpoints (logstashserver.coralogix.com, logstash.coralogix.in, logstashserver.coralogix.us) are retired and no longer accept data. See Deprecation of Coralogix-hosted Logstash.

Set the General values (Send-Your-Data API key, application name, and subsystem name) in your Logstash configuration, not in metricbeat.yml.

Here is a basic example of a metricbeat.yml file for collecting metrics from a Redis server:

metricbeat.modules:
- module: redis
enabled: true
hosts: ["redis:6379"]
metricsets: ["info", "keyspace"]
period: 10s

output.logstash:
enabled: true
hosts: ["<logstash-ip-address>:5044"]

With Docker​

Build Docker image with your metricbeat.yml:

FROM docker.elastic.co/beats/metricbeat:6.6.2

LABEL description="Metricbeat metrics data collector"

# Adding configuration file for Metricbeat
COPY metricbeat.yml /usr/share/metricbeat/metricbeat.yml

# Changing permission of configuration file
USER root
RUN chown root:metricbeat /usr/share/metricbeat/metricbeat.yml

# Return to deploy user
USER metricbeat

Usage​

You can also deploy with Docker-compose:

version: '3.6'
services:
redis:
image: redis:latest
container_name: redis

metricbeat:
image: docker.elastic.co/beats/metricbeat:6.6.2
container_name: metricbeat
volumes:
- ./metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro

Make sure you change the owner of the metricbeat.yml file to root (uid=1000).

Last updated on