步骤 3:使用新的选项名称编辑

filestream 中对多个选项进行了重命名。您可以在本指南末尾的表格中找到所有已更改的配置名称。

您必须了解的最重要的更改是在解析器中。 multilinejson 和其他解析器的配置已更改。现在可以对排序进行配置,因此 filestream 需要一个解析器列表。此外,json 解析器已重命名为 ndjson

前面显示的示例配置也需要进行调整

- type: filestream
  enabled: true
  id: my-java-collector
  take_over: true
  paths:
    - /var/log/java-exceptions*.log
  parsers:
    - multiline:
        pattern: '^\['
        negate: true
        match: after
  close.on_state_change.removed: true
  close.on_state_change.renamed: true

- type: filestream
  enabled: true
  id: my-application-input
  take_over: true
  paths:
    - /var/log/my-application*.json
  prospector.scanner.check_interval: 1m
  parsers:
    - ndjson:
        keys_under_root: true

- type: filestream
  enabled: true
  id: my-old-files
  take_over: true
  paths:
    - /var/log/my-old-files*.log
  ignore_inactive: since_last_start

日志输入中的选项名称

filestream 输入中的选项名称

recursive_glob.enabled

prospector.scanner.recursive_glob

harvester_buffer_size

buffer_size

max_bytes

message_max_bytes

json

parsers.n.ndjson

multiline

parsers.n.multiline

exclude_files

prospector.scanner.exclude_files

close_inactive

close.on_state_change.inactive

close_removed

close.on_state_change.removed

close_eof

close.reader.on_eof

close_timeout

close.reader.after_interval

close_inactive

close.on_state_change.inactive

scan_frequency

prospector.scanner.check_interval

tail_files

ignore_inactive.since_last_start

symlinks

prospector.scanner.symlinks

backoff

backoff.init

backoff_max

backoff.max