if [type] == "system" {
elasticsearch {
hosts => ["192.168.26.144:9200"]
index => "system-%{+YYYY.MM.dd}"
}
}
if [type] == "es-error" {
elasticsearch {
hosts => ["192.168.26.144:9200"]
index => "es-error-%{+YYYY.MM.dd}"
}
}
}
logstash -f /root/file.conf #日志生成到ES上
部署kibana 1.安装kibana
wget https://download.elastic.co/kibana/kibana/kibana-4.3.1-linux-x64.tar.gz
tar zxvf kibana-4.3.1-linux-x64.tar.gz -C /opt/
mv /opt/kibana-4.3.1-linux-x64/ /usr/local/
cd /usr/local
mv kibana-4.3.1-linux-x64/ kibana2.��辑kibana配置文件
vim /usr/local/kibana/config/kibana.yml
#2行
server.port: 5601
#5行
server.host: "0.0.0.0"
#12行 ES地址
elasticsearch.url: "http://192.168.26.144:9200"
#20行
kibana.index: ".kibana"
yum install screen -y
screen #开启
/usr/local/kibana/bin/kibana
ctrl+a+d 进行丢入后台 4.访问kibana
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx