Docker container cannot send log to docker ELK stack

泪湿孤枕 提交于 2019-12-06 15:41:51

You can get your container logs by configuring Logstash as follows and running the container whose logs are to be viewed by changing its default log driver to syslog.

#logstash.conf

input {
  tcp {
    port => 5000
  }
}

output {
  stdout {}
}

The below container's logs will reach the logstash and and can be viewed through stdout.

docker run --log-driver=syslog --log-opt syslog-address=tcp://<logstash-system-ip>:5000 <image>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!