centos

如何优化Filebeat在CentOS的资源使用

小樊
47
2025-11-29 19:17:34
栏目: 智能运维

Filebeat在CentOS的资源使用优化指南

一 基线评估与监控

二 输入与文件处理优化

三 队列与输出层优化

四 系统资源与运行环境优化

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

# filebeat.yml 示例(7.x+)
filebeat.inputs:
- type: filestream
  paths:
    - /var/log/*.log
  ignore_older: 168h
  close_inactive: 2h
  max_bytes: 1048576
  multiline:
    pattern: '^\d{4}-\d{2}-\d{2}'
    negate: true
    match: after
    max_lines: 200
    timeout: 5s

queue:
  type: persisted
  max_bytes: 512MiB
  flush:
    min_events: 1024

output.elasticsearch:
  hosts: ["http://es:9200"]
  bulk_max_size: 5000
  compression: true
  worker: 2

processors:
  - drop_fields:
      fields: ["agent", "ecs", "host"]   # 仅示例:去掉不需要的顶层字段,减少事件体积
      ignore_missing: true

0
看了该问题的人还看了