centos

如何在CentOS上优化Filebeat日志采集速度

小樊
42
2025-12-13 13:56:07
栏目: 智能运维

CentOS上优化Filebeat日志采集速度

一 基线检查与系统资源

二 输入与采集层优化

三 队列与内存策略

四 输出与网络层优化

五 推荐参数示例与落地步骤

filebeat.inputs:
- type: filestream
  paths:
    - /var/log/*.log
  ignore_older: 24h
  close_inactive: 5m
  max_concurrent_files: 10
  harvester_limit: 16
  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
  multiline.negate: true
  multiline.match: after
  multiline.max_lines: 500

queue:
  type: persisted
  max_bytes: 1GB
  flush.min_events: 2048

output.elasticsearch:
  hosts: ["http://es-node:9200"]
  worker: 4
  bulk_max_size: 10000
  flush_interval: 1s
  compression: gzip
  # 如 ES 版本较老,可用 workers 替代 worker

processors:
  - drop_fields:
      fields: ["agent.ephemeral_id", "agent.id", "agent.type", "agent.version", "ecs.version"]
      ignore_missing: true

0
看了该问题的人还看了