Promtail file match lib (doublestar) version mismatch with doc

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"

Please feel free to submit a bug on GitHub - grafana/loki: Like Prometheus, but for logs., but my understanding is that promtail will not be updated anymore, and the default logging agent is now Grafana Alloy.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.