步骤 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

log 输入中的选项名称

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