centos

CentOS中Filebeat资源消耗优化

小樊
40
2025-11-27 20:00:11
栏目: 智能运维

CentOS 上 Filebeat 资源消耗优化

一 基线评估与监控

二 输入与采集策略优化

三 队列与输出层优化

四 处理器与系统资源优化

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

filebeat.inputs:
- type: filestream
  paths:
    - /var/log/*.log
  ignore_older: 168h
  close_inactive: 2h
  max_bytes: 10485760
  multiline:
    pattern: '^\d{4}-\d{2}-\d{2}'
    negate: true
    match: after
    max_lines: 200

queue.mem:
  events: 2048
  flush:
    min_events: 1024
    timeout: 1s

# 如需持久化队列(抗重启),取消注释并调整大小
# queue.type: persisted
# queue.max_bytes: 1GB

output.elasticsearch:
  hosts: ["http://es:9200"]
  bulk_max_size: 2000
  worker: 2
  compression: true
  flush_interval: 1s

logging.level: warning

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

0
看了该问题的人还看了