Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions x-pack/dockerlogbeat/pipelinemanager/libbeattools.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
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
}
Expand Down Expand Up @@ -90,7 +90,7 @@
}

// 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()
Expand All @@ -113,6 +113,7 @@
Version: vers,
EphemeralID: eid,
ID: id,
Logger: logger,
}

return info, nil
Expand All @@ -133,7 +134,7 @@
//return the UUID if it exists
if err == nil {
m := meta{}
if err := json.NewDecoder(f).Decode(&m); err != nil && err != io.EOF { //nolint:errorlint // keep old behaviour

Check failure on line 137 in x-pack/dockerlogbeat/pipelinemanager/libbeattools.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

directive `//nolint:errorlint // keep old behaviour` is unused for linter "errorlint" (nolintlint)
f.Close()
return uuid.Nil, fmt.Errorf("error reading %s: %w", metaPath, err)
}
Expand Down
12 changes: 10 additions & 2 deletions x-pack/dockerlogbeat/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`


Expand Down
Loading