轉載請注明出處
https://blog.csdn.net/aa464971/article/details/102569615
簡介
Elastic官網:https://www.elastic.co
Elastic Github:https://github.com/elastic
- Elasticsearch: 全文搜尋引擎
- Kibana:可視化分析平台
- Filebeat:日志采集
安裝
Elasticsearch
brew install elastic/tap/elasticsearch-full
Kibana
brew install elastic/tap/kibana-full
Filebeat
brew install elastic/tap/filebeat-full
配置
配置Filebeat
比對要輸入的Log檔案路徑
vim /usr/local/etc/filebeat/filebeat.yml
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsICM38FdsYkRGZkRG9lcvx2bjxiNx8VZ6l2csg3YU9EMZRkToZkMMBjVtJWd0ckW65UbM5WOHJWa5kHT20ESjBjUIF2X0hXZ0xCMx81dvRWYoNHLrdEZwZ1Rh5WNXp1bwNjW1ZUba9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZwpmL3QDN4EjMzYTM1EDMxkTMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.jpg)
開啟Kibana中文
打開配置檔案,将
i18n.locale
的注釋去掉,改成
zh-CN
vim /usr/local/etc/kibana/kibana.yml
啟動
前台啟動
需要3個終端視窗,分别啟動
filebeat -e -d "publish"
elasticsearch
kibana
背景啟動
nohup filebeat -e -d "publish" >/dev/null 2>log &
nohup elasticsearch >/dev/null 2>log &
nohup kibana >/dev/null 2>log &
全部啟動完成後,打開浏覽器通路 http://localhost:5601
*添加Apache日志
将資料添加到 Kibana
将
setup.kibana
中的
host
注釋去掉
vim /usr/local/etc/filebeat/filebeat.yml
開啟Apache
filebeat modules enable apache
filebeat setup
修改apache的Log路徑
vim /usr/local/etc/filebeat/modules.d/apache.yml