iT邦幫忙

2021 iThome 鐵人賽

DAY 3
1

在上一篇中我們已經把elk的環境設定完成,接下來將要收集log到Elasticsearch內,以方便進行log查看。

Install Filebeat

curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.14.1-darwin-x86_64.tar.gz
tar xzvf filebeat-7.14.1-darwin-x86_64.tar.gz
cd filebeat-7.14.1-darwin-x86_64

其它系統安裝參考

設定filebeat.yml

filebeat.inputs:

# 設定要抓取log的路徑
- type: filestream
  enabled: true
  paths:
    - /usr/local/var/log/nginx/*.log

# 設定kibana
setup.kibana:
  host: "localhost:5601"

# 設定elasticsearch
output.elasticsearch:
  hosts: ["localhost:9200"]

啟動filebeat

./filebeat -e
./filebeat -e -c filebeat.yml

前往kibana介面,建立index欄位
https://ithelp.ithome.com.tw/upload/images/20210907/20129762utgtSm6CBr.png
到kibana去查看log資料
https://ithelp.ithome.com.tw/upload/images/20210907/20129762V1AwZ2B36H.png

小結

由上述的filebeat安裝,到如何快速使用filebeat來抓取資料,我們已經能初步的使用filebeat,在接下來的章節中,我們將會再進一步的了解filebeat.yml的詳細設定用法,以便能更好使用filebeat。


上一篇
Day02 快速安裝ELK
下一篇
day04 Filebeat(二) 自定索引
系列文
Elastic Stack(ELK)數據圖表化與異常監控30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

0
obarisk
iT邦研究生 2 級 ‧ 2021-09-12 09:21:32

用 instream 取代 input

我要留言

立即登入留言