Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix templating patterns wildcard matching #6135

Merged
merged 3 commits into from
Jul 19, 2019
Merged

Conversation

GeorgeMac
Copy link
Contributor

Closes: #5894

This fixes an issue within templating rules used by line formats like the graphite format. The templating rules do not exhaustively explore all matches. The moment a match is found at any level, if the search fails to match the filters children it will bail out and return a nil template (which gets replace by teh caller with a default template).

Instead the template should return to the previous successful match and check to see if a wildcard exists which can also be explored.

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@GeorgeMac GeorgeMac changed the title Gm/graphite template Fix templating patterns wildcard matching Jul 17, 2019
internal/templating/engine_test.go Outdated Show resolved Hide resolved
@GeorgeMac
Copy link
Contributor Author

GeorgeMac commented Jul 19, 2019

@danielnelson which milestone should we put this in?

@danielnelson danielnelson added this to the 1.11.3 milestone Jul 19, 2019
@danielnelson danielnelson added the fix pr to fix corresponding bug label Jul 19, 2019
@danielnelson danielnelson merged commit 77b1a43 into master Jul 19, 2019
@danielnelson danielnelson deleted the gm/graphite-template branch July 19, 2019 20:14
danielnelson pushed a commit that referenced this pull request Jul 22, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arbitrary rule can cause all Graphite templates to be ignored
2 participants