[英]Filebeat not pushing logs to Elasticsearch
我是Docker和所有這些日志記錄人員的新手,所以也許我犯了一個嚴重的錯誤,所以感謝您提前提供幫助。 我有ELK通過Dockerfile行運行一個docker容器(6.2.2):
FROM sebp/elk:latest
在另一個容器中,我通過以下Dockerfile行安裝和運行Filebeat:
RUN curl -L -O -k https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.2.2-amd64.deb
RUN dpkg -i filebeat-6.2.2-amd64.deb
COPY resources/filebeat/filebeat.yml /etc/filebeat/filebeat.yml
RUN chmod go-w /etc/filebeat/filebeat.yml
RUN /usr/share/filebeat/bin/filebeat -e -d "publish" &
我的Filebeat配置是:
filebeat.prospectors:
- type: log
enabled: true
paths:
- /jetty/jetty-distribution-9.3.8.v20160314/logs/*.log
output.logstash:
enabled: false
hosts: ["elk-stack:9002"]
#index: 'audit'
output.elasticsearch:
enabled: true
hosts: ["elk-stack:9200"]
#index: "audit-%{+yyyy.MM.dd}"
path.config: "/etc/filebeat"
#setup.template.name: "audit"
#setup.template.pattern: "audit-*"
#setup.template.fields: "${path.config}/fields.yml"
如您所見,我試圖在Elasticsearch中創建自定義索引,但是現在我只是想先嘗試使用默認索引。 碼頭日志均具有全局讀取權限。
docker容器日志未顯示任何錯誤,運行后,請確保配置和輸出正常:
# filebeat test config
Config OK
# filebeat test output
elasticsearch: http://elk-stack:9200...
parse url... OK
connection...
parse host... OK
dns lookup... OK
addresses: 172.17.0.3
dial up... OK
TLS... WARN secure connection disabled
talk to server... OK
version: 6.2.2
/ var / log / filebeat / filebeat顯示:
2018-03-15T13:23:38.859Z INFO instance/beat.go:468 Home path: [/usr/share/filebeat] Config path: [/etc/filebeat] Data path: [/var/lib/filebeat] Logs path: [/var/log/filebeat]
2018-03-15T13:23:38.860Z INFO instance/beat.go:475 Beat UUID: ed5cecaf-cbf5-438d-bbb9-30bab80c4cb9
2018-03-15T13:23:38.860Z INFO elasticsearch/client.go:145 Elasticsearch url: http://elk-stack:9200
2018-03-15T13:23:38.891Z INFO elasticsearch/client.go:690 Connected to Elasticsearch version 6.2.2
但是當我打localhost:9200 / _cat / indices?v時,它不返回任何索引:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
我該如何工作? 我沒主意。 再次感謝任何幫助。
要回答我自己的問題,您不能使用以下命令啟動文件拍:
RUN /usr/share/filebeat/bin/filebeat -e -d "publish" &
並在容器啟動后使其繼續運行。 需要手動啟動它或使用ENTRYPOINT標記將其啟動在自己的容器中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.