Skip to content

get default values when deserializing protobuf events using parse_proto #23046

Answered by pront
amirongit asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @amirongit,

In your source, after you do:

result = parse_proto!(decode_base64!("<some bytes>"), "resources/protobuf_descriptor_set.desc", "test_protobuf.Person") 

You can use exists and if a field is not present, explicitly set it to the default value.

Long term we can see if a emit_defaults optional argument can be added to parse_proto so that it adds these fields while traversing the proto instances.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pront
Comment options

Answer selected by amirongit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
domain: vrl Anything related to the Vector Remap Language
2 participants