We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How we can grab the hostname of the server on which the container is runnig and send this hostname to the logs agregator: syslog-ng, logstash etc.?
Something we got when we use: docker service logs SERVICE|TASK And the output is:
docker service logs SERVICE|TASK
node_app_1.7.zyp3bh58k6dn@SRVNAME | app listening on port 80 node_app_1.7.zyp3bh58k6dn@SRVNAME | queryDb took 35 ms ("select * from visits limit 1") node_app_1.7.zyp3bh58k6dn@SRVNAME | db error Error: read ECONNRESET node_app_1.7.zyp3bh58k6dn@SRVNAME | at TCP.onStreamRead (internal/stream_base_commons.js:201:27) { node_app_1.7.zyp3bh58k6dn@SRVNAME | errno: 'ECONNRESET', node_app_1.7.zyp3bh58k6dn@SRVNAME | code: 'ECONNRESET', node_app_1.7.zyp3bh58k6dn@SRVNAME | syscall: 'read', node_app_1.7.zyp3bh58k6dn@SRVNAME | fatal: true node_app_1.7.zyp3bh58k6dn@SRVNAME | } node_app_1.7.zyp3bh58k6dn@SRVNAME | /usr/src/app/src/db-mysql.js:139 node_app_1.7.zyp3bh58k6dn@SRVNAME | throw err; node_app_1.7.zyp3bh58k6dn@SRVNAME | ^ node_app_1.7.zyp3bh58k6dn@SRVNAME | node_app_1.7.zyp3bh58k6dn@SRVNAME | Error: read ECONNRESET node_app_1.7.zyp3bh58k6dn@SRVNAME | at TCP.onStreamRead (internal/stream_base_commons.js:201:27) { node_app_1.7.zyp3bh58k6dn@SRVNAME | errno: 'ECONNRESET', node_app_1.7.zyp3bh58k6dn@SRVNAME | code: 'ECONNRESET', node_app_1.7.zyp3bh58k6dn@SRVNAME | syscall: 'read', node_app_1.7.zyp3bh58k6dn@SRVNAME | fatal: true node_app_1.7.zyp3bh58k6dn@SRVNAME | }
The text was updated successfully, but these errors were encountered:
OK. I'm able to have hostname on which the containter is running using environment variable for example:
-e "SYSLOG_HOSTNAME={{.Container.Config.Hostname}}@`hostname`"
Sorry, something went wrong.
You can also mount the host /etc/hostname inside the container as described in the README: https://github.com/gliderlabs/logspout#using-logspout-in-a-swarm
/etc/hostname
version: "3" networks: logging: services: logspout: image: gliderlabs/logspout:latest networks: - logging volumes: - /etc/hostname:/etc/host_hostname:ro - /var/run/docker.sock:/var/run/docker.sock
No branches or pull requests
How we can grab the hostname of the server on which the container is runnig and send this hostname to the logs agregator: syslog-ng, logstash etc.?
Something we got when we use:
docker service logs SERVICE|TASK
And the output is:
The text was updated successfully, but these errors were encountered: