splunk / docker-logging-plugin

Splunk Connect for Docker is a Docker logging plugin that allows docker containers to send their logs directly to Splunk Enterprise or a Splunk Cloud deployment.
Apache License 2.0
65 stars 25 forks source link

Error response from daemon: logger: no log driver named 'splunk-logging-plugin:latest' is registered #47

Closed MiaMish closed 6 years ago

MiaMish commented 6 years ago

I'm trying to use the docker logging plugin on my environment, but cannot get any container to run when using it.

I've started a Splunk server instance on a docker container using https://hub.docker.com/r/splunk/splunk/, exposing 8000 and 8088 ports, and enabled HTC and generated a token.

Then I run following commands successfully:

docker plugin install splunk/docker-logging-plugin:latest --alias splunk-logging-plugin docker plugin enable splunk-logging-plugin

However, when I try to run any custom image, I'm getting an error:

docker run \
    --name=my-server \
    --network=$DOCKER_NETWORK \
    -v /logs:/logs \
    -p0.0.0.0:8017:8017 \
    --restart unless-stopped \
    --log-driver=splunk-logging-plugin:latest \
    --log-opt splunk-token=888dee70-6168-4d91-971f-17e977982204 \
    --log-opt splunk-url=http://localhost:8088 \
    --log-opt tag="{{.Name}}/{{.FullID}}" \
    --log-opt labels=my-server \
    --log-opt env=TEST \
    --env "TEST=true" \
    --label source=my-server \
    -d my-server

docker: Error response from daemon: logger: no log driver named 'splunk-logging-plugin:latest' is registered.

I tried also with the alias, and with a global daemon.json, all resulted with the same errors.

Docker version 17.03.2-ce, build f5ec1e2 Ubuntu 16.04.4 LTS

luckyj5 commented 6 years ago

Hi @MiaMish, can you please run this command on your docker host docker info | grep "Logging Driver" and share the results? This will tell us if the splunk-logging-plugin is registered as current logging driver or not. Thanks!

MiaMish commented 6 years ago

@luckyj5 the command returns the following:

Logging Driver: json-file

Do I need to un-register the existing logging driver?

MiaMish commented 6 years ago

Using --log-driver=splunk worked