diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 751eb9508598..5bd0d92c09f6 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -333,7 +333,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403] *Elastic Logging Plugin* - +- Fix for unable to run elastic-logging plugin ==== Added diff --git a/x-pack/dockerlogbeat/pipelinemanager/libbeattools.go b/x-pack/dockerlogbeat/pipelinemanager/libbeattools.go index b4820f734088..eba0bcb4cff8 100644 --- a/x-pack/dockerlogbeat/pipelinemanager/libbeattools.go +++ b/x-pack/dockerlogbeat/pipelinemanager/libbeattools.go @@ -42,7 +42,7 @@ func loadNewPipeline(logOptsConfig ContainerOutputConfig, hostname string, log * return nil, fmt.Errorf("unpacking config failed: %w", err) } - info, err := getBeatInfo(logOptsConfig, hostname) + info, err := getBeatInfo(logOptsConfig, hostname, log) if err != nil { return nil, err } @@ -90,7 +90,7 @@ func loadNewPipeline(logOptsConfig ContainerOutputConfig, hostname string, log * } // getBeatInfo returns the beat.Info type needed to start the pipeline -func getBeatInfo(pluginOpts ContainerOutputConfig, hostname string) (beat.Info, error) { +func getBeatInfo(pluginOpts ContainerOutputConfig, hostname string, logger *logp.Logger) (beat.Info, error) { vers := version.GetDefaultVersion() eid, err := uuid.NewV4() @@ -113,6 +113,7 @@ func getBeatInfo(pluginOpts ContainerOutputConfig, hostname string) (beat.Info, Version: vers, EphemeralID: eid, ID: id, + Logger: logger, } return info, nil diff --git a/x-pack/dockerlogbeat/readme.md b/x-pack/dockerlogbeat/readme.md index 6919e47f0efb..521053063aec 100644 --- a/x-pack/dockerlogbeat/readme.md +++ b/x-pack/dockerlogbeat/readme.md @@ -4,11 +4,19 @@ This code is a working MVP for a [docker logging plugin](https://docs.docker.com/engine/extend/plugins_logging/). With the proper config, it can send logs to elasticsearch. ## Build and install -To build and install, just run `mage Package`. The build process happens entire within docker. The only external dependencies are [mage](https://github.com/magefile/mage#installation) and golang. +To build and install, just run `mage package`. The build process happens entirely within docker. The only external dependencies are [mage](https://github.com/magefile/mage#installation) and golang. +## How to start the plugin -## Running +1. To create and enable the plugin, follow below steps +``` +cd x-pack/dockerlogbeat/build/distribution +tar -xvf elastic-logging-plugin-9.2.0-docker-plugin-arm64.tar.gz ## unpack the tar ball +docker plugin create dockerlogbeat ./elastic-logging-plugin +docker plugin enable dockerlogbeat +``` +2. To start the plugin `docker run --log-driver=elastic/elastic-logging-plugin:8.0.0 --log-opt hosts="172.18.0.2:9200" -it debian:jessie /bin/bash`