一、环境
https://www.cnblogs.com/suffergtf/p/9566145.html
1、收取日志文件到elasticsearch
[root@linux-node1 logstash.d]# vim messages.conf input { file { ######收取日志文件 path => "/var/log/messages" #####路径 start_position => "beginning" #####从文件起始行开始,默认为收取新内容(被logstash引用过的日志文件,下次即使新建索引,也只从末端开始读取,) }}output { elasticsearch { ######将收取到的日志,发送到elasticsearch hosts => "192.168.127.201:9200" ####定义接收端elasticsearch index => "messages-%{+YYYY.MM.dd}" #####新建索引 }}