1. Kibana简单使用
1.1 Kibana配置
[root@linux-node1 /opt/kibana/config]# egrep -v "#|^$" kibana.yml server.port: 5601 server.host: "0.0.0.0" elasticsearch.url: "http://192.168.56.11:9200" #es地址 kibana.index: ".kibana" #kibana索引,用于保存kibana配置
1.2 启动Kibana
[root@linux-node1 /opt/kibana/config]# /etc/init.d/kibana start
1.3 Kibana日志展示
2. 系统日志收集
2.1 记录系统日志
[root@linux-node1 ~]# cat /etc/logstash/conf.d/file.conf input{ file{ path => ["/var/log/messages","/var/log/secure"] #日志文件地址 type => "system-log" #类型,可以自己指定,作逻辑判断 start_position => "beginning" #从文件头开始收集,默认为文件尾追加收集 } } filter{ } output{ elasticsearch { hosts => ["192.168.56.11:9200"] index => "system-log-%{+YYYY.MM}" } } [root@linux-node1 /etc/logstash/conf.d]# /opt/logstash/bin/logstash -f /etc/logstash/conf.d/file.conf Settings: Default pipeline workers: 1 Pipeline main started