采集配置

iLogtail流水线是通过采集配置文件来定义的,每一个采集配置文件对应一条流水线。

格式

采集配置文件支持json和yaml文件格式,每个采集配置的一级字段如下:

参数 类型 是否必填 默认值 说明
enable bool true 是否使用当前配置。
global object 全局配置。
global.EnableTimestampNanosecond bool false 否启用纳秒级时间戳,提高时间精度。
inputs [object] / 输入插件列表。目前只允许使用1个输入插件。
processors [object] 处理插件列表。
aggregators [object] 聚合插件列表。目前最多只能包含1个聚合插件,所有输出插件共享。
flushers [object] / 输出插件列表。至少需要包含1个输出插件。
extenstions [object] 扩展插件列表。

其中,inputs、processors、aggregators、flushers和extenstions中可包含任意数量的插件

组织形式

本地的采集配置文件默认均存放在./config/local目录下,每个采集配置一个文件,文件名即为采集配置的名称。

热加载

采集配置文件支持热加载,当您在./config/local目录下新增或修改已有配置文件,iLogtail将自动感知并重新加载配置。生效等待时间最长默认为10秒,可通过启动参数config_scan_interval进行调整。

示例

一个典型的采集配置如下所示:

enable: true
inputs:
  - Type: input_file
    FilePaths: 
      - /home/test-log/reg.log
processors:
  - Type: processor_parse_regex_native
    SourceKey: content
    Regex: (\d*-\d*-\d*)\s(.*)
    Keys:
      - time
      - msg
flushers:
  - Type: flusher_stdout
    OnlyStdout: true

其它常见的采集配置可参考example_config目录.

results matching ""

    No results matching ""