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

fix(parsers.xpath): Handle explicitly defined fields correctly #13550

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Jul 5, 2023

resolves #13531

Currently, the fields_bytes_as_hex option only takes effect on batch definitions of fields but is ignored on explicitly defined fields. The proposed PR changes this and allows to also represent explicitly defined fields in hex-encoding.

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser plugins labels Jul 5, 2023
@srebhan srebhan self-assigned this Jul 5, 2023
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Jul 5, 2023

@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 Jul 5, 2023
@srebhan srebhan assigned powersj and unassigned srebhan Jul 5, 2023
@powersj powersj assigned srebhan and unassigned powersj Jul 5, 2023
@powersj
Copy link
Contributor

powersj commented Jul 5, 2023

@srebhan assigning to you to await user feedback

@tulku
Copy link
Contributor

tulku commented Jul 6, 2023

I tested these changes. I was able to configure:

(...)
fields_bytes_as_hex = ["sensor_samples"]
[inputs.http_listener_v2.xpath.fields]
  sensor_samples = "//n9390"

And verified that the generated metric has the sensor_samples field as an hex_string.

@srebhan srebhan merged commit 57bcdaf into influxdata:master Jul 6, 2023
24 checks passed
@srebhan srebhan deleted the xpath_hex_encode branch July 6, 2023 14:16
@srebhan srebhan added this to the v1.27.2 milestone Jul 10, 2023
powersj pushed a commit that referenced this pull request Jul 10, 2023
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/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser 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.

Xpath fields_bytes_as_hex configuration does not work on defined fields
3 participants