mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Merge remote-tracking branch 'origin/topic/seth/zeek_init'
* origin/topic/seth/zeek_init: Some more testing fixes. Update docs and tests for bro_(init|done) -> zeek_(init|done) Implement the zeek_init handler.
This commit is contained in:
commit
a994be9eeb
628 changed files with 868 additions and 1082 deletions
|
@ -19,7 +19,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Info]);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
|
||||
redef LogAscii::separator = "|";
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Info]);
|
||||
Log::write(SSH::LOG, [$data="abc\n\xffdef", $data2="DATA2"]);
|
||||
|
|
|
@ -23,7 +23,7 @@ function logwrite(val: double)
|
|||
Log::write(Test::LOG, [$d=val]);
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
local d: double;
|
||||
local dmax: double = 1.79e308;
|
||||
|
|
|
@ -23,7 +23,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
local a = "abc\0def";
|
||||
local b = escape_string(a);
|
||||
|
|
|
@ -14,7 +14,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(test::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
Log::write(Test::LOG, [$x=LogAscii::unset_field, $z=""]);
|
||||
|
|
|
@ -11,7 +11,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ export {
|
|||
redef Log::default_rotation_interval = 1hr;
|
||||
redef LogAscii::gzip_level = 1;
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ function foo(i : count) : string
|
|||
return "Bar";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
local filter = Log::Filter($name="ssh-uncompressed", $path="ssh-uncompressed",
|
||||
|
|
|
@ -17,7 +17,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::write(SSH::LOG, [
|
||||
|
|
|
@ -17,7 +17,7 @@ export {
|
|||
global log_test: event(rec: Info);
|
||||
}
|
||||
|
||||
event bro_init() &priority=5
|
||||
event zeek_init() &priority=5
|
||||
{
|
||||
Log::create_stream(testing::LOG, [$columns=testing::Info, $ev=log_test]);
|
||||
local info: Info;
|
||||
|
|
|
@ -40,7 +40,7 @@ function foo(i : count) : string
|
|||
return "Bar";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ export {
|
|||
};
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Info]);
|
||||
Log::write(Test::LOG, [$data="Test1"]);
|
||||
|
|
|
@ -19,7 +19,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export {
|
|||
};
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Info]);
|
||||
Log::write(Test::LOG, [$data=double_to_time(1234567890)]);
|
||||
|
|
|
@ -17,7 +17,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ redef record Log += {
|
|||
} &log;
|
||||
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
};
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ export {
|
|||
|
||||
global log_ssh: event(rec: Log);
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log, $ev=log_ssh]);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ export {
|
|||
|
||||
global ssh_log: event(rec: Log);
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log, $ev=ssh_log]);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ event kill_worker()
|
|||
Broker::publish("death", slow_death);
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
if ( Cluster::node == "worker-1" )
|
||||
{
|
||||
|
|
|
@ -55,7 +55,7 @@ event kill_worker()
|
|||
Broker::publish("death", slow_death);
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
if ( Cluster::node == "worker-1" )
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
|
||||
const foo_log = open_log_file("Foo") &redef;
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::write(SSH::LOG, [$t=network_time(), $f=foo_log]);
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ export {
|
|||
|
||||
redef Log::enable_local_logging = F;
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
local config: table[string] of string;
|
||||
config["foo"]="bar";
|
||||
|
|
|
@ -16,7 +16,7 @@ function split_log(id: Log::ID, path: string, rec: record {id:conn_id;}): string
|
|||
return Site::is_local_addr(rec$id$orig_h) ? "local" : "remote";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
# Add a new filter to the Conn::LOG stream that logs only
|
||||
# timestamp and originator address.
|
||||
|
|
|
@ -28,7 +28,7 @@ function path_func(id: Log::ID, path: string, rec: Log) : string
|
|||
return fmt("%s-%d-%s", path, c, rec$country);
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::remove_default_filter(SSH::LOG);
|
||||
|
|
|
@ -24,7 +24,7 @@ function fail(rec: Log): bool
|
|||
return rec$status != "success";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
Log::remove_default_filter(Test::LOG);
|
||||
|
|
|
@ -20,7 +20,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::add_filter(SSH::LOG, [$name="f1", $path="ssh.failure", $pred=function(rec: Log): bool { return rec$status == "failure"; }]);
|
||||
|
|
|
@ -28,7 +28,7 @@ function custom_rotate(info: Log::RotationInfo) : bool
|
|||
return T;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
Log::add_filter(Test::LOG, [$name="2nd", $path="test2", $interv=30mins, $postprocessor=custom_rotate]);
|
||||
|
|
|
@ -21,7 +21,7 @@ export {
|
|||
redef Log::default_rotation_interval = 1hr;
|
||||
redef Log::default_rotation_postprocessor_cmd = "echo";
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ function foo(i : count) : string
|
|||
return "Bar";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::remove_filter(SSH::LOG, "default");
|
||||
|
|
|
@ -32,7 +32,7 @@ function foo(i : count) : string
|
|||
return "Bar";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::remove_filter(SSH::LOG, "default");
|
||||
|
|
|
@ -47,7 +47,7 @@ function foo(i : count) : string
|
|||
return "Bar";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::create_stream(SSH::LOG2, [$columns=Log]);
|
||||
|
|
|
@ -45,7 +45,7 @@ function foo(i : count) : string
|
|||
return "Bar";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
Log::remove_filter(SSH::LOG, "default");
|
||||
|
|
|
@ -16,7 +16,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export {
|
|||
} &log;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ function foo(i : count) : string
|
|||
return "Bar";
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ type Bar: record {
|
|||
b: count &log;
|
||||
};
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(TESTING, [$columns=Bar]);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export {
|
|||
};
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
Log::create_stream(SSH::LOG, [$columns=Log]);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
@load base/protocols/http
|
||||
|
||||
event bro_init()
|
||||
event zeek_init()
|
||||
{
|
||||
# Both the default filter for the http stream and this new one will
|
||||
# attempt to have the same writer write to path "http", which will
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue