Type to search.

Install and configure the Elastic Logging Plugin

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Make sure your system meets the following prerequisites:

  • Docker: Engine API 1.25 or later
  • Elastic Stack: Version 7.6.0 or later
  1. Install the plugin. You can install it from the Docker store (recommended), or build and install the plugin from source in the beats GitHub repo.

    To install from the Docker store:

    Shell
    docker plugin install elastic/elastic-logging-plugin:9.5.6
    

    To build and install from source:

    Set up your development environment and then run:

    Shell
    cd x-pack/dockerlogbeat
    mage BuildAndInstall
    
  2. If necessary, enable the plugin:

    Shell
    docker plugin enable elastic/elastic-logging-plugin:9.5.6
    
  3. Verify that the plugin is installed and enabled:

    Shell
    docker plugin ls
    

    The output should say something like:

    Shell
    ID                  NAME                                   DESCRIPTION              ENABLED
    c2ff9d2cf090        elastic/elastic-logging-plugin:9.5.6   A beat for docker logs   true
    

You can set configuration options for a single container, or for all containers running on the host. See Configuration options for a list of supported configuration options.

To configure a single container:

Pass configuration options at run time when you start the container. For example:

Shell
docker run --log-driver=elastic/elastic-logging-plugin:9.5.6 \
           --log-opt hosts="https://myhost:9200" \
           --log-opt user="myusername" \
           --log-opt password="mypassword" \
           -it debian:jessie /bin/bash

To configure all containers running on the host:

Set configuration options in the Docker daemon.json configuration file. For example:

JSON
{
  "log-driver" : "elastic/elastic-logging-plugin:9.5.6",
  "log-opts" : {
    "hosts" : "https://myhost:9200",
    "user" : "myusername",
    "password" : "mypassword"
  }
}
Note

The default location of the daemon.json file varies by platform. On Linux, the default location is /etc/docker/daemon.json. For more information, see the Docker docs.