文档首页/ 数据接入服务 DIS/ 常见问题/ DIS Agent相关问题/ Agent如何配置监听多目录或文件?
更新时间:2022-02-22 GMT+08:00

Agent如何配置监听多目录或文件?

DIS Agent支持配置监听多个目录或文件,例如想收集"/home/folder1/file1""/home/folder2/file2"这两个文件的日志,可以通过配置多个DISStream来实现:

---
region: REGION
ak: YOUR_AK
sk: YOUR_SK
projectId: YOUR_PROJECTID
endpoint: ENDPOINT
flows:
  - DISStream: YOUR_STREAM
    filePattern: /home/folder1/file1
    initialPosition: START_OF_FILE
    maxBufferAgeMillis: 5000

  - DISStream: YOUR_STREAM
    filePattern: /home/folder2/file2
    initialPosition: START_OF_FILE
    maxBufferAgeMillis: 5000