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

Issues with tag matching in Graphite templates #1731

Closed
kostasb opened this issue Sep 8, 2016 · 1 comment · Fixed by #1871
Closed

Issues with tag matching in Graphite templates #1731

kostasb opened this issue Sep 8, 2016 · 1 comment · Fixed by #1871
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@kostasb
Copy link

kostasb commented Sep 8, 2016

version: 1.0.0

Configuring multiple templates for the Graphite input format will result in the shortest template matching successfully while the rest are ignored.

Example:

templates=["measurement.host.metric.metric.metric"]
input: net.server001.a.b.c 2
output: net,host=server001,metric=a.b.c value=2 timestamp
templates=["measurement.host.metric.metric.metric","measurement.host.metric.metric"]
input: net.server001.a.b.c 2
output: net,host=server001,metric=a.b value=2 
templates=["measurement.host.metric.metric.metric","measurement.host.metric.metric","measurement.host.metric"]
input: net.server001.a.b.c 2
output: net,host=server001,metric=a value=2

Greedy matching (like metric*) which is supported for measurements and fields but not tags, could be considered as a solution.

@nhaugo nhaugo added this to the 1.1.0 milestone Sep 15, 2016
@nhaugo nhaugo added the bug unexpected problem or unintended behavior label Sep 15, 2016
sparrc added a commit that referenced this issue Oct 10, 2016
Previously, the graphite parser would simply overwrite any template that
had an identical filter to a previous template. This included the empty
filter.

This change automatically creates a "*." filter for any template
specified with an empty filter. This allows users to specify only a
template, and Telegraf will auto-match based on the most specific
template.

closes #1731
sparrc added a commit that referenced this issue Oct 10, 2016
Previously, the graphite parser would simply overwrite any template that
had an identical filter to a previous template. This included the empty
filter.

This change automatically creates a "*." filter for any template
specified with an empty filter. This allows users to specify only a
template, and Telegraf will auto-match based on the most specific
template.

closes #1731
sparrc added a commit that referenced this issue Oct 10, 2016
Previously, the graphite parser would simply overwrite any template that
had an identical filter to a previous template. This included the empty
filter.

Now we will still overwrite, but first we will sort to make sure that
the most "specific" template always matches.

closes #1731
sparrc added a commit that referenced this issue Oct 11, 2016
Previously, the graphite parser would simply overwrite any template that
had an identical filter to a previous template. This included the empty
filter.

Now we will still overwrite, but first we will sort to make sure that
the most "specific" template always matches.

closes #1731
sparrc added a commit that referenced this issue Oct 11, 2016
Previously, the graphite parser would simply overwrite any template that
had an identical filter to a previous template. This included the empty
filter.

Now we will still overwrite, but first we will sort to make sure that
the most "specific" template always matches.

closes #1731
sparrc added a commit that referenced this issue Oct 11, 2016
Previously, the graphite parser would simply overwrite any template that
had an identical filter to a previous template. This included the empty
filter.

Now we will still overwrite, but first we will sort to make sure that
the most "specific" template always matches.

closes #1731
@teraflik
Copy link

@sparrc Does telegraf support wildcard matching for tags?

For example

templates=["measurement.host.metric"]
input: net.server001.a.b.c 2

Will the output be
net,host=server001,metric=a value=2 or net,host=server001,metric=a.b.c value=2

If it will be the first, is there a way to achieve second?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants