Skip to content

fix(processors.strings): Add explicit TOML tags on struct fields #17210

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

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

skartikey
Copy link
Contributor

Summary

When struct fields don’t have explicit TOML tags, the TOML library uses the field names directly for mapping. However, it can only access exported fields (i.e., those starting with a capital letter).

In this case, the fields are unexported (lowercase), so the TOML parser can’t see them, which leads to the error:

configuration specified the fields ["new" "tag" "old"], but they were not used

That's why these fields need to be exported or have proper TOML tags to be recognized.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #17208

@skartikey skartikey force-pushed the processors_strings_fix branch from c24078f to 6973c39 Compare June 19, 2025 12:43
@telegraf-tiger
Copy link
Contributor

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @skartikey!

@srebhan srebhan 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 Jun 20, 2025
@srebhan srebhan removed their assignment Jun 20, 2025
@mstrandboge mstrandboge merged commit e2cd9cf into influxdata:master Jun 23, 2025
26 of 27 checks passed
@github-actions github-actions bot added this to the v1.35.1 milestone Jun 23, 2025
srebhan pushed a commit that referenced this pull request Jun 23, 2025
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 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
Development

Successfully merging this pull request may close these issues.

processors.strings.replace no longer works in 1.35.0
3 participants