filebeat 常見的inputs、outputs總結


inputs

log
sdtin

- type: stdin

redis slowlog

- type: redis
  enabled: true
  hosts: ["localhost:6379"]
  password: foobared

  ## How often the input checks for redis slow log.
  #scan_frequency: 10s

  ## Timeout after which time the input should return an error
  #timeout: 1s

  ## Network type to be used for redis connection. Default: tcp
  #network: tcp

  ## 最大並發連接數。默認值:10
  #maxconn: 10

udp

- type: udp
  enabled: true
  #host: 'localhost:8080'
  
  ##通過UDP接收的消息的最大大小 
  #max_message_size: 10KiB

  ##UDP讀取緩沖區的大小(以字節為單位)
  #read_buffer: 0

tcp

- type: tcp
  enabled: true

  ## The host and port to receive the new event
  #host: "localhost:9000"

  ## Character used to split new message
  #line_delimiter: "\n"

  ##通過TCP接收消息的最大字節
  #max_message_size: 20MiB

  ##最大並發鏈接數,0表示無限制。默認:0
  #max_connections: 0

  ##多久關閉處於非活動狀態的鏈接。
  #timeout: 300s

syslog

# Experimental: Config options for the Syslog input
# Accept RFC3164 formatted syslog event via UDP.
#- type: syslog
  #enabled: false
  #protocol.udp:
    # The host and port to receive the new event
    #host: "localhost:9000"

    # Maximum size of the message received over UDP
    #max_message_size: 10KiB

# Accept RFC3164 formatted syslog event via TCP.
#- type: syslog
  #enabled: false

  #protocol.tcp:
    # The host and port to receive the new event
    #host: "localhost:9000"

    # Character used to split new message
    #line_delimiter: "\n"

    # Maximum size in bytes of the message received over TCP
    #max_message_size: 20MiB

    # The number of seconds of inactivity before a remote connection is closed.
    #timeout: 300s

outputs

logstash

output.logstash:
  enabled: true
  hosts: ["127.0.0.1:5044"]

  # Number of workers per Logstash host.
  worker: 1

  # Optionally load-balance events between Logstash hosts. Default is false.
  #loadbalance: false

  # Number of batches to be sent asynchronously to Logstash while processing new batches.
  #pipelining: 2

  ##網絡錯誤后嘗試重新連接到Logstash之前等待的秒數。
  #backoff.init: 1s

  #網絡錯誤后嘗試連接到Logstash之前等待的最大秒數。默認值為60秒。
  #backoff.max: 60s

  ##可選索引名稱。默認索引名設置為filebeat,全部小寫。
  #index: 'filebeat'
  
  ##發布失敗后重試發布事件的次數。
  #max_retries: 3

  ##單個Logstash請求中要批量處理的最大事件數。默認值為2048。
  #bulk_max_size: 2048

elasticsearch

output.elasticsearch:
  enabled: true
  hosts: ["localhost:9200"]

  ##協議 - either `http` (default) or `https`.
  #protocol: "https"

  ##身份驗證憑據-API密鑰或用戶名/密碼
  api_key: "id:api_key"
  username: "elastic"
  password: "changeme"
  
  ##通過索引操作在URL中傳遞的HTTP參數字典
  #parameters:
    #param1: value1
    #param2: value2

  # Number of workers per Elasticsearch host.
  #worker: 1

  ##可選索引名稱。默認值是“filebeat”加上日期並生成[filebeat-]年月日。
  #index: "filebeat-%{[agent.version]}-%{+yyyy.MM.dd}"

  # Optional ingest node pipeline. By default no pipeline will be used.
  #pipeline: ""

  # Optional HTTP path
  #path: "/elasticsearch"

  ##要添加到每個請求的自定義HTTP頭
  #headers:
  #  X-My-Header: Contents of the header

  ##嘗試索引操作的重試次數。如果索引操作在多次重試后沒有成功,則事件將被刪除。默認值為3。
  #max_retries: 3

  #單個Elasticsearch批量API索引請求中要批量處理的最大事件數。默認值為50。
  #bulk_max_size: 50

  ##網絡錯誤后嘗試重新連接到Elasticsearch之前等待的秒數
  #backoff.init: 1s

  ##網絡錯誤后嘗試連接到Elasticsearch之前等待的最大秒數。默認值為60秒。
  #backoff.max: 60s

  ##在請求Elasticsearch失敗之前配置HTTP請求超時。
  #timeout: 90

kafka
file

output.file:
  enabled: true
  codec.json:
    pretty: true 
    escape_html: true
  path: "/data/logs/filebeat"
  filename: filebeat_output.log
  rotate_every_kb: 10000
  number_of_files: 7
  permissions: 0600

redis

output.redis:
  enabled: true
  codec.json:
    pretty: false
    escape_html: false
  hosts: ["localhost:6379"]
  key: filebeat
  password: '*****'
  db: 0

  ##發布事件的Redis數據類型。如果數據類型為list,則使用RPUSH命令;如果數據類型為channel,則使用PUBLISH命令。默認值為list。
  datatype: list

  ##發布事件到每個Redis的工作線程數。將此設置與loadbalance選項一起使用。例如,如果有2台主機和3台工作機,則總共啟動6台工作機(每個主機3台)。
  worker: 1

  #如果設置為true並且配置了多個hosts或worker,則會將發布的事件負載平衡到所有Redis主機上。
  #如果設置為false,則只向一個主機發送所有事件(隨機確定),如果當前選定的主機無法訪問,則將切換到另一個主機。
  #默認值為true。
  loadbalance: true

  timeout: 5s
  ##發布失敗后重試發布事件的次數。在指定的重試次數之后,通常會刪除事件。
  max_retries: 3

  ##網絡錯誤后等待多久嘗試重新連接到Redis。
  backoff.init: 1s

  ##網絡錯誤后嘗試連接到Redis之前等待的最大秒數。默認值為60秒。
  #backoff.max: 60s

  #單個Redis請求或管道中要批量處理的最大事件數。默認值為2048。
  bulk_max_size: 2048

console

output.console:
  enabled: true
  codec.json:
    pretty: false
    escape_html: false


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM