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

Error while decoding json invalid character \x00 #108

Open
netixx opened this issue May 15, 2019 · 0 comments
Open

Error while decoding json invalid character \x00 #108

netixx opened this issue May 15, 2019 · 0 comments

Comments

@netixx
Copy link

netixx commented May 15, 2019

In IPFIX and Netflow, additionnal kind of records named "options" exists, such as interface table, vrf table or sampler options. They are additionnal mapping (eg. vrf_index => vrf_name) that are usefull when storing flows.

The templates for those usually advertise (tested on Cisco ASR) large size for the fields (such as 64 for vrf name). But the actual value is of variable length.

This leads to errors when decoding the json on the consumer (at least in golang), because the vflow producer uses string(*byteValue), which contains null bytes, to encode the data in json, and the golang stdlib for decoding json does not allow null byte in string litterals.

We could use the golang bytes.Trim function to remove the null bytes before encoding to string to avoid this problem (although I don't know about the performance impact of this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant