1下載及解壓安裝包linux
filebeat-7.3.1-linux-x86_64.tar.gz
2. 相關配置項
web
filebeat.inputs: - type: log #定義收集日誌的類型 enable: true #不使用自有收集日誌的模板,而是使用手動配置獲取日誌 paths: - /var/log/messages/ - /var/log/secure/ #配置獲取的日誌文件,也可使用模糊獲取日誌,*.log fields: log_topic: osmessages #定義kafka topic名稱 name:"10.10.23.39" #收集日誌的主機名 ----------------如下是輸出配置------------------------------------ output.kafka: enabled:true hosts:["10.10.23.39:9092","10.10.23.40:9092","10.10.23.41:9092"] version: "0.10" topic:'%{[fields][log_topic]}' #引用topic至kafka partition.round_robin: reachable_only:true worker: 2 required_acks: 1 compression:gzip max_message_bytes:10000000 ---------------如下是日誌輸出配置----------------------------------- #================================ Logging ====================== # Sets log level. The default log level is info. # Available log levels are: error, warning, info, debug #logging.level: debug logging.level: debug # At debug level, you can selectively enable logging only for some components. # To enable all selectors use ["*"]. Examples of other selectors are "beat", # "publish", "service". #logging.selectors: ["*"]
3.Filebeat 啓動方式bash
4.Filebeat 自過濾服務器
processors: - drop_fields: fields: ["beat", "host", "agent", "source", "offset", "prospector"]
5. Filebeat 獲取日誌輸出服務器IPide
#================================ General ===================== # The name of the shipper that publishes the network data. It can be used to group # all the transactions sent by a single shipper in the web interface. name: 10.10.23.42 # The tags of the shipper are included in their own field with each # transaction published. #tags: ["service-X", "web-tier"] # Optional fields that you can specify to add additional information to the # output. #fields: # env: staging