install elasticsearch
brew install elasticsearch // 安裝
brew info elasticsearch // 查看信息
brew services start elasticsearch // 啓動
- 訪問9200端口
install kibana
brew install kibana
brew info kibana
brew services start kibana
install logstash
brew install logstash
brew info logstash
brew services start logstash
- 創建一個test.txt文件作爲導入源
- 創建 .conf 文件 // 任何目錄下均可
vim test_blog.conf
input {
file {
path => ["/Users/admin/study/ELK/test.txt"]
}
}
output {
elasticsearch{
hosts => ["http://localhost:9200"]
index => "test_blog"
}
}
執行如下命令
logstash -f test_blog.conf
訪問localhost:9600, 可以看到如下界面:
然後隨意在test.txt文件中更改一些內容並保存, 此時訪問localhost:9200可以看到如下界面,test_blog 索引已經被加入。
在dev tools 執行 : GET _cat/indices
使用kibana可視化
經過上述步驟後訪問localhost:5601,切換到Management section, 可以看到test_blog index 已經被創建。
參考文獻
ELK搭建
附上
各組件的配置路徑