DataDog目录文件匹配模式无法匹配任何文件

DataDog Directory file matching pattern fails to match any files

该目录包含 20 多个文件。 如 DataDog directory documentation 中所述,最多可以跟踪 20 个文件。

所以我尝试配置数据狗目录配置

init_config:

instances:
  - directory: /mnt/ftp/generic/SalesorderPosition
    pattern: '20([0-9][0-9]_12_+.*).csv'
    filegauges: true

文件采用下一种格式yyyy_mm_SalesorderPosition.csv 我需要显示所有以前年份的最新月份。

在配置中启用模式时,没有匹配的文件。当我删除它时,文件被计算在内。

我错过了什么?

阅读您链接的文档。该模式是 fnmatch 模式,而不是正则表达式。

https://docs.python.org/3/library/fnmatch.html

更新:

确切的工作解决方案是

init_config:

instances:
  - directory: /mnt/ftp/generic/SalesorderPosition
    pattern: '*_12_SalesorderPosition.csv'
    filegauges: true