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

Support encoding structs with the undocumented vector-based broker encoding for zeek records #3

Open
simeonmiteff opened this issue Jan 11, 2024 · 0 comments

Comments

@simeonmiteff
Copy link
Collaborator

From zeek/zeek/discussions/2879:

Mapping Zeek's records to Broker's data model expects records as a tuple of values, with each member in its own Broker-model rendering. The vector must cover the full list of fields, including Nones for optional ones.

This actually works. Assuming

type Foo: record {
  bar: string;
  baz: count;
};

...we could construct a value like this:

encoding.Vector(
  encoding.String("value of bar"),
  encoding.Count(42),
)

We could add support to go-zeek-broker-ws to encode Go structs in this manner, but given the discussion referenced above: should we?

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