String replacer function to strings plugin#4686
Merged
danielnelson merged 3 commits intoinfluxdata:masterfrom Sep 27, 2018
Merged
String replacer function to strings plugin#4686danielnelson merged 3 commits intoinfluxdata:masterfrom
danielnelson merged 3 commits intoinfluxdata:masterfrom
Conversation
added 3 commits
September 12, 2018 11:50
merge upstream master
Contributor
Author
|
@danielnelson i added a bit more than just the substring replacement in this PR since we need the ability to run a replace on every metric going through, but i'd imagine '*' should be fairly contained since it's likely not a valid name for the existing tags/fields/metrics 🤞 . If you can take a look that'd be awesome. Thanks! |
danielnelson
approved these changes
Sep 14, 2018
glinton
approved these changes
Sep 17, 2018
| if c.Dest != "" { | ||
| dest = c.Dest | ||
| for tag, value := range tags { | ||
| dest := tag |
Contributor
There was a problem hiding this comment.
Maybe reuse tag in place of dest, to save an allocation.
| if fv, ok := fv.(string); ok { | ||
| metric.AddField(dest, c.fn(fv)) | ||
| for tag, value := range fields { | ||
| dest := tag |
Contributor
There was a problem hiding this comment.
Again, just use tag instead of dest
rgitzel
pushed a commit
to rgitzel/telegraf
that referenced
this pull request
Oct 17, 2018
otherpirate
pushed a commit
to otherpirate/telegraf
that referenced
this pull request
Mar 15, 2019
otherpirate
pushed a commit
to otherpirate/telegraf
that referenced
this pull request
Mar 15, 2019
dupondje
pushed a commit
to dupondje/telegraf
that referenced
this pull request
Apr 22, 2019
athoune
pushed a commit
to bearstech/telegraf
that referenced
this pull request
Apr 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required for all PRs:
In reference to #4599
Adding the ability to replace substrings in a field, tag, or measurement. Also adding the ability to
match on multiple of the resource with '*'. With that active, the
destfield is ignored and the same data is written back to the same field name to avoid writing all modified data to the same field name.