-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Decoder for Base64 Encoded Binary data
input.
#14950
Comments
@rc-networks could you please add |
Here is the output with
I don't see the
outputs without the
|
Oh sorry @rc-networks I think you need to do with |
@rc-networks can you please test the binary in #14961, available once CI finished the tests!? You should be able to convert the data above using [[inputs.file]]
files = ["./test_configs/gnmi_issue_14950.influx"]
data_format = "influx"
[[processors.parser]]
parse_fields = ["openconfig_platform_psu:capacity"]
merge = "override"
data_format = "binary"
endianness = "be"
binary_encoding = "base64"
[[processors.parser.binary]]
entries = [{ name = "openconfig_platform_psu:capacity", type = "float32" }]
[[processors.parser]]
parse_fields = ["openconfig_platform_psu:input_current"]
merge = "override"
data_format = "binary"
endianness = "be"
binary_encoding = "base64"
[[processors.parser.binary]]
entries = [{ name = "openconfig_platform_psu:input_current", type = "float32" }]
[[processors.parser]]
parse_fields = ["openconfig_platform_psu:input_voltage"]
merge = "override"
data_format = "binary"
endianness = "be"
binary_encoding = "base64"
[[processors.parser.binary]]
entries = [{ name = "openconfig_platform_psu:input_voltage", type = "float32" }]
[[processors.parser]]
parse_fields = ["openconfig_platform_psu:output_current"]
merge = "override"
data_format = "binary"
endianness = "be"
binary_encoding = "base64"
[[processors.parser.binary]]
entries = [{ name = "openconfig_platform_psu:output_current", type = "float32" }]
[[processors.parser]]
parse_fields = ["openconfig_platform_psu:output_power"]
merge = "override"
data_format = "binary"
endianness = "be"
binary_encoding = "base64"
[[processors.parser.binary]]
entries = [{ name = "openconfig_platform_psu:output_power", type = "float32" }]
[[processors.parser]]
parse_fields = ["openconfig_platform_psu:output_voltage"]
merge = "override"
data_format = "binary"
endianness = "be"
binary_encoding = "base64"
[[processors.parser.binary]]
entries = [{ name = "openconfig_platform_psu:output_voltage", type = "float32" }] |
Thank you! I tried putting multiple entries on the
|
Yes, because the parser gets the data field-by-field so your config will not work. Do you know if transporting floats as base64 encoded strings is a standard method in GNMI? If so, could you please point me to some official documentation? |
@srebhan As for the question above, it's not about the GNMI, it's about the model that is being used.
|
@rc-networks so if this encoding is used, is it used for all data reported by the device or is this a per-subscription thing? |
@srebhan It would be used on all data that is using models that return binary data. |
@rc-networks thanks! Could you please open another feature request for the GNMI plugin, providing the link above, an (redacted) example configuration and some data with |
Use Case
Needed for decoding
Base64 Encoded Binary data
input.For example, we have settings like this:
and the data coming in looks like this:
Model
opeconfig-platform-cpu
specifies that we should expect a binary data as stated here:(image taken from YANGSUITE app)
The values for most of the fields are Base64 encoded strings,
which needs to be convert to binary data,
which we then need to convert to float (ieeefloat32) as specified in the specification above.
Expected behavior
Base64 Encoded String Data comes in.
Process field values to be converted to Binary Data.
Binary Data converted to type
float
before sending to the output plugin.Actual behavior
Currently not possible as far as I am informed.
Issue also discussed on Slack
Additional info
No response
The text was updated successfully, but these errors were encountered: