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

**URL:** https://discuss.elastic.co/t/elastic-logging-plugin-for-docker-error-creating-client-config-a-hosts-flag-is-required/323202
**Category:** Beats
**Tags:** docker, beats-module
**Created:** [January 15, 2023, 9:37pm UTC](https://discuss.elastic.co/t/elastic-logging-plugin-for-docker-error-creating-client-config-a-hosts-flag-is-required/323202 "2023-01-15T21:37:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kthy/32/45385_2.png) [@kthy](https://discuss.elastic.co/u/kthy)
#### Post date: [January 15, 2023, 9:37pm UTC](https://discuss.elastic.co/t/elastic-logging-plugin-for-docker-error-creating-client-config-a-hosts-flag-is-required/323202/1 "2023-01-15T21:37:08Z")

</div>

This question is about the [Elastic Logging Plugin for Docker](https://www.elastic.co/guide/en/beats/loggingplugin/current/log-driver-overview.html), 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:

```auto
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
d607d29e005413ef07cd2e37dfb9f12e9055a1de4fae552a45ce15d36c756133
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](https://www.elastic.co/guide/en/beats/loggingplugin/current/log-driver-configuration.html) doesn't say that the `hosts` log-opt is mandatory, and it should definitely be unnecessary when using Elastic Cloud for log collection. Halp?

---

<div class="post-metadata">

### Author: ![kthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kthy/32/45385_2.png) [@kthy](https://discuss.elastic.co/u/kthy)
#### Post date: [January 16, 2023, 11:12am UTC](https://discuss.elastic.co/t/elastic-logging-plugin-for-docker-error-creating-client-config-a-hosts-flag-is-required/323202/2 "2023-01-16T11:12:18Z")

</div>

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

Annoying and confusing, but hey.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 13, 2023, 1:12pm UTC](https://discuss.elastic.co/t/elastic-logging-plugin-for-docker-error-creating-client-config-a-hosts-flag-is-required/323202/3 "2023-02-13T13:12:23Z")

</div>

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