Elastic Logging Plugin for Docker: "error creating client config: A hosts flag is required"

This question is about the Elastic Logging Plugin for Docker , which doesn't have it's own category on the Elastic forums. Sad.

I have tried creating a docker container with the Elastic logging plugin, but I get an error message:

kthy@wiki:~$ docker plugin ls
ID             NAME                                   DESCRIPTION              ENABLED
1d6cfaa3f152   elastic/elastic-logging-plugin:8.6.0   A beat for docker logs   true
kthy@wiki:~$ docker create --name=wiki-update-companion -v /var/run/docker.sock:/var/run/docker.sock:ro --restart=unless-stopped -h wiki-update-companion --network=wikinet --log-driver=elastic/elastic-logging-plugin:8.6.0 --log-opt cloud_id="foo:e3W…NCr=" --log-opt max-file=10 --log-opt max-size=5M --log-opt api_key="id…6n:Y4…PQ" ghcr.io/requarks/wiki-update-companion:latest
kthy@wiki:~$ docker start wiki-update-companion
Error response from daemon: failed to initialize logging driver: error creating logger: LogDriver.StartLogging: error creating client config: A hosts flag is required
Error: failed to start containers: wiki-update-companion

The manual doesn't say that the hosts log-opt is mandatory, and it should definitely be unnecessary when using Elastic Cloud for log collection. Halp?

Specifying --log-opt hosts="" makes the error go away and logs appear in Elastic Cloud.

Annoying and confusing, but hey.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.