mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Merge remote-tracking branch 'origin/topic/awelzel/zeekctl-multiple-loggers'
* origin/topic/awelzel/zeekctl-multiple-loggers: NEWS: Add entry for ZeekControl and multi-loggers Bump zeekctl to multi-logger version logging: Support rotation_postprocessor_command_env
This commit is contained in:
commit
004dce2cf2
8 changed files with 115 additions and 9 deletions
|
@ -0,0 +1,32 @@
|
|||
# @TEST-DOC: Using a custom environment for the postprocessor command.
|
||||
# @TEST-EXEC: ZEEK_ARG_EXTERNAL=external zeek -b -r ${TRACES}/rotation.trace %INPUT >out 2>&1
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
module Test;
|
||||
|
||||
export {
|
||||
redef enum Log::ID += { LOG };
|
||||
|
||||
type Log: record {
|
||||
t: time;
|
||||
id: conn_id;
|
||||
} &log;
|
||||
}
|
||||
|
||||
redef Log::default_rotation_interval = 1hr;
|
||||
redef Log::default_rotation_postprocessor_cmd = "env | grep ZEEK_ARG | sort; true ";
|
||||
|
||||
redef Log::default_rotation_postprocessor_cmd_env += {
|
||||
["REDEF"] = "redef",
|
||||
};
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
Log::default_rotation_postprocessor_cmd_env["INIT"] = "zeek_init";
|
||||
}
|
||||
|
||||
event new_connection(c: connection)
|
||||
{
|
||||
Log::write(Test::LOG, [$t=network_time(), $id=c$id]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue