mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
[Spicy] Extend functionality of export
in EVT files.
We now support selecting which fields of a unit type get exported into the automatically created Zeek record; as well as selecting which fields get a `&log` attribute added automatically to either all fields or to selected fields. Syntax: - To export only selected fields: export Foo::X with { field1, field3 }; - To export all but selected fields: export Foo::X without { field2, field3 }; - To `&log` all fields: export Foo::X &log; - To `&log` only selected fields: export Foo::X with { field1 &log, field3 }; # exports (only) field1 and field3, and marks field1 for logging Syntax is still subject to change. Closes #3218. Closes #3219.
This commit is contained in:
parent
83029ecafc
commit
cdadd934ce
13 changed files with 287 additions and 11 deletions
|
@ -29,7 +29,7 @@ declare public void raise_event(EventHandlerPtr handler, vector<Val> args) &cxxn
|
|||
declare public BroType event_arg_type(EventHandlerPtr handler, uint<64> idx) &cxxname="zeek::spicy::rt::event_arg_type" &have_prototype;
|
||||
declare public Val to_val(any x, BroType target) &cxxname="zeek::spicy::rt::to_val" &have_prototype;
|
||||
|
||||
type RecordField = tuple<string, BroType, bool>; # (ID, type, optional)
|
||||
type RecordField = tuple<string, BroType, bool, bool>; # (ID, type, optional, log)
|
||||
declare public BroType create_base_type(ZeekTypeTag tag) &cxxname="zeek::spicy::rt::create_base_type" &have_prototype;
|
||||
declare public BroType create_enum_type(string ns, string id, vector<tuple<string, int<64>>> labels) &cxxname="zeek::spicy::rt::create_enum_type" &have_prototype;
|
||||
declare public BroType create_record_type(string ns, string id, vector<RecordField> fields) &cxxname="zeek::spicy::rt::create_record_type" &have_prototype;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue