-
so here's the proto syntax = "proto3";
package mdm.v1.base;
enum DeviceType {
MASTER = 0;
SLAVE = 1;
}
enum CommandType {
CLOCK = 0;
...
}
message Data {
DeviceType device_type = 1;
CommandType command_type = 2;
}
and here is the message published in nats: {
"device_type": 0,
"command_type": 1
} in vector.json configuration, I have a transform with type remap, which uses a simple VRL script to parse proto; this is the script: the problem is that, when the value for the field I need to include all the fields in the output of this script. how do I do it? is it possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
ps: it's protobuf itself omitting default values. |
Beta Was this translation helpful? Give feedback.
Hi @amirongit,
In your source, after you do:
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 toparse_proto
so that it adds these fields while traversing the proto instances.