Skip to content

fix(inputs.nftables): Handle plain string elements in set unmarshalling#18686

Merged
srebhan merged 1 commit intoinfluxdata:masterfrom
skartikey:fix/nftables-static-set-elem-unmarshal
Apr 16, 2026
Merged

fix(inputs.nftables): Handle plain string elements in set unmarshalling#18686
srebhan merged 1 commit intoinfluxdata:masterfrom
skartikey:fix/nftables-static-set-elem-unmarshal

Conversation

@skartikey
Copy link
Copy Markdown
Contributor

Summary

Statically defined nftables sets return plain strings in the elem array while dynamically added entries return objects. The empty elem struct could not unmarshal strings, causing a JSON unmarshalling error. Add a custom UnmarshalJSON that accepts any JSON value type since the plugin only counts elements.

Checklist

Related issues

resolves #18685

Statically defined nftables sets return plain strings in the elem array
while dynamically added entries return objects. The empty elem struct
could not unmarshal strings, causing a JSON unmarshalling error. Add a
custom UnmarshalJSON that accepts any JSON value type since the plugin
only counts elements.

Closes influxdata#18685
@skartikey skartikey self-assigned this Apr 9, 2026
@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Apr 9, 2026
@telegraf-tiger
Copy link
Copy Markdown
Contributor

telegraf-tiger bot commented Apr 9, 2026

@skartikey skartikey assigned srebhan and mstrandboge and unassigned skartikey Apr 10, 2026
Copy link
Copy Markdown
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.

Looks good to me. 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 Apr 16, 2026
@srebhan srebhan merged commit 1f82cc8 into influxdata:master Apr 16, 2026
27 checks passed
@github-actions github-actions bot added this to the v1.38.3 milestone Apr 16, 2026
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/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins 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.

Telegraf nftables plugin - unmarshall error in set

3 participants