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

feat: Extend regexp processor do allow renaming of measurements, tags and fields #9561

Merged
merged 16 commits into from
Nov 4, 2021

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Jul 30, 2021

  • Updated associated README.md.
  • Wrote appropriate unit tests.

resolves #5159
resolves #9506
resolves #9557

related to #6830, #6831

With this PR, the regexp processor is able to rename measurements, tags and fields using regular expressions. To do so, the user specifies what to rename using the key property. Furthermore, the user has control over the behavior in case the resulting tag or field name already exists by changing the result_key value between overwrite and keep.

@srebhan srebhan added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/processor labels Jul 30, 2021
Copy link
Member

@helenosheaa helenosheaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @srebhan! Someone was just asking about this functionality yesterday. The extended measurement functionality looks great and nice refactor.

@ihard
Copy link
Contributor

ihard commented Jul 31, 2021

Hi, I tested the assembly, it works as expected on my data (correct replacement of metric names).

@sspaink sspaink changed the title Extend regexp processor do allow renaming of measurements, tags and fields feat: Extend regexp processor do allow renaming of measurements, tags and fields Aug 11, 2021
plugins/processors/regex/README.md Outdated Show resolved Hide resolved
@bai
Copy link

bai commented Oct 6, 2021

👋🏼 Friendly bump to see if it's something that can be shipped?

@srebhan
Copy link
Member Author

srebhan commented Oct 6, 2021

@bai I'm waiting for the response of @reimda if adding sections processors.regex.tag_rename, processors.regex.field_rename and processors.regex.metric_rename is ok for him as this would render the key field meaningless for those sections.
Once I get the feedback, I can change the code. :-)

plugins/processors/regex/README.md Show resolved Hide resolved
plugins/processors/regex/README.md Outdated Show resolved Hide resolved
plugins/processors/regex/README.md Outdated Show resolved Hide resolved
plugins/processors/regex/README.md Outdated Show resolved Hide resolved
plugins/processors/regex/regex.go Outdated Show resolved Hide resolved
plugins/processors/regex/regex.go Outdated Show resolved Hide resolved
plugins/processors/regex/regex.go Show resolved Hide resolved
plugins/processors/regex/regex.go Outdated Show resolved Hide resolved
plugins/processors/regex/regex.go Outdated Show resolved Hide resolved
srebhan and others added 8 commits October 13, 2021 12:56
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
…r unused 'result_key' for metrics_rename sections.
plugins/processors/regex/regex.go Outdated Show resolved Hide resolved
plugins/processors/regex/regex.go Outdated Show resolved Hide resolved
@srebhan srebhan requested a review from Hipska October 20, 2021 11:56
@Hipska Hipska added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Oct 20, 2021
@powersj
Copy link
Contributor

powersj commented Oct 28, 2021

@reimda can you sign-off on this PR? You had a previous discussion around naming and functionality that would be good to get your +1 on.

Thanks!

@reimda
Copy link
Contributor

reimda commented Nov 2, 2021

During my first review I thought there was overlap of functionality with the old settings and new ones. It makes much more sense looking at it now. Sorry to delay merging.

@srebhan Was there anything else you wanted to change?

@srebhan
Copy link
Member Author

srebhan commented Nov 3, 2021

No I'm happy with the current state when you are. :-)

@reimda reimda merged commit fb5b541 into influxdata:master Nov 4, 2021
VladislavSenkevich pushed a commit to gwos/telegraf that referenced this pull request Nov 23, 2021
@srebhan srebhan mentioned this pull request Dec 7, 2021
3 tasks
@blockloop
Copy link
Contributor

What version can we expect this to be part of?

@Hipska
Copy link
Contributor

Hipska commented Jul 8, 2022

Hi, it is already available in the latest versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/processor ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
8 participants