轻量化收集与消费

收集端

Filebeat

filebeat.config:
  modules:
    path: ${path.config}/modules.d/*.yml
    reload.enabled: false

processors:
  - add_cloud_metadata: ~

filebeat.inputs:
  - type: filestream
    paths:
      - /data/logs/*.log
    fields:
      vpc: test
      saltid: test
    fields_under_root: true


output.redis:
  hosts: ["127.0.0.1:6379"]
  password: "password"
  key: "filebeat"
  db: 15
  timeout: 5

  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000

Vector

TIP

这里的密码之前需要加一个冒号,是官方的规范

[sources.test]
type = "redis"
key = "filebeat"
url = "redis://:password@127.0.0.1:6379/15"
decoding.codec = "json"