zeek/testing/btest/logging/vec.bro
Robin Sommer 38a1aa5a34 &log keyword, and vector logging.
The &log keyword now operates as discussed:

    - When associated with individual record fields, it defines them
      as being logged.

    - When associated with a complete record type, it defines all fields
      to be logged.

    - When associated with a record extension, it defines all added
      fields to be logged.

    Note that for nested record types, the inner fields must likewise
    be declared with &log. Consequently, conn_id is now declared with
    &log in bro.init.

Vectors are now allowed to be logged and will be recorded as an
ordered set of items.
2011-03-28 18:14:05 -07:00

27 lines
332 B
Text

#
# @TEST-EXEC: bro %INPUT
# @TEST-EXEC: btest-diff ssh.log
module SSH;
export {
redef enum Log::ID += { SSH };
type Log: record {
vec: vector of string &log;
};
}
event bro_init()
{
Log::create_stream(SSH, [$columns=Log]);
local v: vector of string;
v[2] = "2";
v[5] = "5";
Log::write(SSH, [$vec=v]);
}