嗨,大家好,我很難將我的服務器容器日誌發送到我的ELK堆棧。沒有輸入發送到logstash,所以我無法設置收集日誌的kibana索引。我認爲我的問題是在端口設置。無法通過gelf驅動程序將docker容器連接到logstash
下面是LAMP堆棧泊塢窗,撰寫陽明海運(僅服務器服務):
version: '3'
services:
server:
build: ./docker/apache
links:
- fpm
ports:
- 80:80 # HTTP
- 443:443 # HTTPS
logging:
driver: "gelf"
options:
gelf-address: "udp://127.0.0.1:5000"
tag: "server"
這裏是麋鹿堆棧泊塢窗,撰寫陽明,基於deviantony/docker-elk github project
version: '2'
services:
elasticsearch:
build: elasticsearch/
volumes:
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
ports:
- "9200:9200"
- "9300:9300"
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
- elk
logstash:
build: logstash/
volumes:
- ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml
- ./logstash/pipeline:/usr/share/logstash/pipeline
ports:
- "5000:5000"
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
- elk
depends_on:
- elasticsearch
kibana:
build: kibana/
volumes:
- ./kibana/config/:/usr/share/kibana/config
ports:
- "5601:5601"
networks:
- elk
depends_on:
- elasticsearch
networks:
elk:
driver: bridge
當然我使用這條管線CONFIG'輸入{ GELF { 端口=> 5000 類型=>搬運工 } } 輸出{ elasticsearch { 主機=>「elasticsearch中:9200 「 } } '但是沒有工作 –
嘗試輸出到stdout而不是彈性,所以你確定問題不在logstash和elastic之間,而是在logstash沒有收到任何東西。我告訴你的配置爲我工作,所以你可以用它來找出你的配置問題。 logstash的日誌說什麼? – herm