filebeat 小巧好用
filebeat.prospectors: - input_type: log paths: - /var/log/nginx/access.log fields: type: "nginx" - input_type: log paths: - /mnt/www/bi.xxxxx.com/app/runtime/tasklog/task_*.log fields: type: "task" json.message_key: log json.keys_under_root: true output.elasticsearch: hosts: ["127.0.0.1:9200"] #index: "logs-%{[beat.version]}-%{+yyyy.MM.dd}" indices: - index: "www-f-nginx-log" when.equals: fields.type: "nginx" - index: "www-f-task-log" when.equals: fields.type: "task" #./filebeat -e -c filebeat.yml -d "Publish"
转载于:https://my.oschina.net/Alexmyj/blog/3016411