https://hub.docker.com/r/elastic/filebeat
docker run -itd --name filebeat \
-v /data/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml \
-v /root/jenkins/logs:/data/jenkins/logs \
-v /etc/localtime:/etc/localtime \
--restart=always \
--privileged=true \
elastic/filebeat
filebeat.inputs:
- type: log
enabled: true
paths:
- /data/jenkins/logs/*.log
tags: ["jenkins"]
fields:
index: "jenkins_log"
setup.kibana:
host: "192.168.0.11:5601"
username: "elastic"
password: "QJpmwK3WJeRKnQ!T"
output.elasticsearch:
hosts: ["192.168.0.11:9201","192.168.0.11:9202","192.168.0.11:9203"]
username: "elastic"
password: "QJpmwK3WJeRKnQ!T"
indices:
- index: "jenkins-log-%{+YYYY-MM}"
when.contains:
fields:
index: "jenkins_log"
签名:这个人很懒,什么也没有留下!