ELK Lesson 13:Logstash基本設定
設定Logstash
步驟1:移動至設定檔目錄,調整jvm.options檔案中的參數,設定JVM的記憶體使用量。
$ cd /etc/logstash
$ sudo vi jvm.options
## JVM configuration
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms1g #初始化最低記憶體
-Xmx1g #最高使用記憶體
可以按照實際需求設置,一般來說,最高不要超過4GB,最低也建議是1GB,若有更高的需求,比較好的方式應該是建立多台Logstash,採行向擴展的方式處理。
步驟2:確認pipelines.yml中設定檔的位置。
# This file is where you define your pipelines. You can define multiple.
# For more information on multiple pipelines, see the documentation:
# https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html
- pipeline.id: main
path.config: "/etc/logstash/conf.d/*.conf"
“path.config:”所指定的目錄與檔名(or 副檔名)就是未來我們要指定輸入/輸出的設定描述檔案位置。
基本上Logstash的基本設定在我們的整個系列中要調整的地方非常少,因為Logstash是作為中繼傳輸資料用,而非大數據應用的ETL角色,所以在此就不多贅述!
~ END ~