Enroll Beats in central managementedit

Warning

This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

You need to enroll Beats to register them in central management and establish trust. Enrolled Beats will have the credentials needed to retrieve configurations from Kibana.

During the enrollment process:

  1. The Beat contacts Kibana and tries to register
  2. Kibana registers the Beat instance and returns an access token for configuration polling
  3. The enroll command creates a backup of your configuration and then overwrites the current settings so they can be managed centrally

To enroll Beats, use either token-based or username and password-based enrollment.

Prerequisitesedit

  • Verify that your Elastic license includes the Beats central management feature.

    Don’t have a license? You can start a 30-day trial. At the end of the trial period, you can purchase a subscription to keep using central management. For more information, see https://www.elastic.co/subscriptions and License Management.

  • Enable security in Kibana to ensure that only users with sufficient privileges are able to access Beats configurations.
  • Assign the beats_admin role to any users who need to enroll Beats or manage configuration settings in central management.
  • If you plan to use the sample Kibana dashboards provided with Metricbeat, load the dashboards before enrolling the Beat.

Token-based enrollmentedit

Token-based enrollment is recommended if you are enrolling Beats manually.

To use token-based enrollment, go to Kibana → Management → Beats and click Enroll Beat. Select the Beat type and operating system, then copy and run the command for enrolling the Beat.

The command has this format:

metricbeat enroll KIBANA_URL TOKEN
KIBANA_URL
The URL of the Kibana instance you will use for central management.
TOKEN
The enrollment token generated by the Central Management UI. The enrollment token will expire as soon as it’s used.

For example:

metricbeat enroll http://xyz.gov:5601 70f4b584e8024b96b682c46125a8d81

Repeat this process to enroll additional Beats.

Important

Windows users: If you installed Metricbeat as a service, you must also set -path.data to "C:\ProgramData\metricbeat" when you run the enroll command. For example:

.\metricbeat.exe enroll http://xyz.gov:5601 70f4b584e8024b96b682c46125a8d81a -path.data "C:\ProgramData\metricbeat"

Why? The service installation script, install-service-metricbeat.ps1, changes the default data path to match the convention used for Windows. If you run the enroll command without specifying the correct data path, Metricbeat will be enrolled in central management with the wrong UUID and unable to receive the configuration.

Username and password-based enrollmentedit

You can also enroll by specifying a username and password. This is the recommended way for scripted deploys:

metricbeat enroll KIBANA_URL --username USER --password METHOD [--force]
--username USER
The username to use for password-based enrollment. The default username is elastic.
--password METHOD

The method to use for getting the password. Available options are:

  • env:VAR_NAME gets the password from the environment variable VAR_NAME
  • stdin prompts the user for a password. This is the default.
--force
Overwrites the current settings without asking for confirmation.

For example:

metricbeat enroll http://xyz.gov:5601 --username myuser --password stdin
Important

Windows users: If you installed Metricbeat as a service, you must also set -path.data to "C:\ProgramData\metricbeat" when you run the enroll command. For example:

.\metricbeat.exe enroll http://xyz.gov:5601 --username myuser --password stdin -path.data "C:\ProgramData\metricbeat"

Why? The service installation script, install-service-metricbeat.ps1, changes the default data path to match the convention used for Windows. If you run the enroll command without specifying the correct data path, Metricbeat will be enrolled in central management with the wrong UUID and unable to receive the configuration.