mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
Merge remote-tracking branch 'origin/master' into topic/johanna/netcontrol
This commit is contained in:
commit
f06e9e6aab
373 changed files with 4001 additions and 2221 deletions
|
@ -1,5 +1,8 @@
|
|||
# @TEST-EXEC: cp input.log input2.log
|
||||
# @TEST-EXEC: btest-bg-run bro bro -b %INPUT
|
||||
# @TEST-EXEC: btest-bg-wait 5
|
||||
# @TEST-EXEC: sleep 2
|
||||
# @TEST-EXEC: echo "hi" >> input2.log
|
||||
# @TEST-EXEC: btest-bg-wait 10
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff out
|
||||
|
||||
@TEST-START-FILE input.log
|
||||
|
@ -7,6 +10,7 @@ sdfkh:KH;fdkncv;ISEUp34:Fkdj;YVpIODhfDF
|
|||
@TEST-END-FILE
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
@load base/frameworks/communication # keep network time running
|
||||
|
||||
global outfile: file;
|
||||
global try: count;
|
||||
|
@ -21,9 +25,8 @@ event line(description: Input::EventDescription, tpe: Input::Event, s: string)
|
|||
{
|
||||
print outfile, s;
|
||||
try = try + 1;
|
||||
if ( try == 2 )
|
||||
if ( try == 3 )
|
||||
{
|
||||
Input::remove("input");
|
||||
close(outfile);
|
||||
terminate();
|
||||
}
|
||||
|
@ -39,7 +42,11 @@ event bro_init()
|
|||
local config_strings_two: table[string] of string = {
|
||||
["offset"] = "-3", # 2 characters before end, last char is newline.
|
||||
};
|
||||
local config_strings_three: table[string] of string = {
|
||||
["offset"] = "-1", # End of file
|
||||
};
|
||||
|
||||
Input::add_event([$source="../input.log", $config=config_strings, $reader=Input::READER_RAW, $mode=Input::STREAM, $name="input", $fields=Val, $ev=line, $want_record=F]);
|
||||
Input::add_event([$source="../input.log", $config=config_strings_two, $reader=Input::READER_RAW, $mode=Input::STREAM, $name="input2", $fields=Val, $ev=line, $want_record=F]);
|
||||
Input::add_event([$source="../input2.log", $config=config_strings_three, $reader=Input::READER_RAW, $mode=Input::STREAM, $name="input3", $fields=Val, $ev=line, $want_record=F]);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# @TEST-EXEC: bro -b %INPUT
|
||||
# @TEST-EXEC: btest-diff testing.log
|
||||
|
||||
@load tuning/json-logs.bro
|
||||
|
||||
module testing;
|
||||
|
||||
export {
|
||||
redef enum Log::ID += { LOG };
|
||||
|
||||
type Info: record {
|
||||
ts: time &log &optional;
|
||||
msg: string &log &optional;
|
||||
};
|
||||
|
||||
global log_test: event(rec: Info);
|
||||
}
|
||||
|
||||
event bro_init() &priority=5
|
||||
{
|
||||
Log::create_stream(testing::LOG, [$columns=testing::Info, $ev=log_test]);
|
||||
local info: Info;
|
||||
info$msg = "Testing 1 2 3 ";
|
||||
Log::write(testing::LOG, info);
|
||||
}
|
||||
|
|
@ -106,6 +106,10 @@ global matched_software: table[string] of Software::Description = {
|
|||
[$name="vsFTPd", $version=[$major=2,$minor=0,$minor2=5], $unparsed_version=""],
|
||||
["Apple Mail (2.1084)"] =
|
||||
[$name="Apple Mail", $version=[$major=2,$minor=1084], $unparsed_version=""],
|
||||
["Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0"] =
|
||||
[$name="AdobeAIR", $version=[$major=1,$minor=0], $unparsed_version=""],
|
||||
["Mozilla/5.0 (Windows; U; en) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0"] =
|
||||
[$name="AdobeAIR", $version=[$major=1,$minor=0], $unparsed_version=""],
|
||||
};
|
||||
|
||||
event bro_init()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue