The file path match lib (doublestar) version doesn’t match the document which is v4.x. Therefore, can’t use {path1, path2, path3} format in promtail configuration inside field: static_configs.labels.__path__ , the fix should be easy as just upgrade the lib version to github.com/bmatcuk/doublestar/v4 v4.6.1 , reference . It’s a really handy feature to match the file path so can we do the change?
To Reproduce
Any version of promtail with following example config:
scrape_configs:
- job_name: example
static_configs:
- labels:
__path__:
"{\
/logs/*-eg*-*/a/*.log,\
/logs/*-eg*-*/b/*.log,\
}"
__path_exclude__:
"{\
/logs/**/*.gz,\
/logs/**/*.swp,\
/logs/**/*.swx,\
}"
Error message example (promtail v2.9.4, git: f599ebc):
level=error ts=2024-08-12T06:01:01.578772464Z caller=filetargetmanager.go:434 msg="failed to match file" error="syntax error in pattern"