mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 13:38:19 +00:00
Copy docs into Zeek repo directly
This is based on commit 99e6942efec5feff50523f6b2a1f5868f19ab638 from the zeek-docs repo.
This commit is contained in:
parent
979a98c73c
commit
adce4e604a
1075 changed files with 169492 additions and 1 deletions
37
doc/frameworks/logging/delay1.zeek
Normal file
37
doc/frameworks/logging/delay1.zeek
Normal file
|
@ -0,0 +1,37 @@
|
|||
@load base/protocols/conn
|
||||
|
||||
redef record Conn::Info += {
|
||||
orig_name: string &log &optional;
|
||||
resp_name: string &log &optional;
|
||||
};
|
||||
|
||||
hook Log::log_stream_policy(rec: Conn::Info, id: Log::ID)
|
||||
{
|
||||
if ( id != Conn::LOG )
|
||||
return;
|
||||
|
||||
local token1 = Log::delay(id, rec);
|
||||
local token2 = Log::delay(id, rec);
|
||||
|
||||
when [id, rec, token1] ( local orig_name = lookup_addr(rec$id$orig_h) )
|
||||
{
|
||||
rec$orig_name = orig_name;
|
||||
Log::delay_finish(id, rec, token1);
|
||||
}
|
||||
timeout 150msec
|
||||
{
|
||||
Reporter::warning(fmt("lookup_addr timeout for %s", rec$id$orig_h));
|
||||
Log::delay_finish(id, rec, token1);
|
||||
}
|
||||
|
||||
when [id, rec, token2] ( local resp_name = lookup_addr(rec$id$resp_h) )
|
||||
{
|
||||
rec$resp_name = resp_name;
|
||||
Log::delay_finish(id, rec, token2);
|
||||
}
|
||||
timeout 150msec
|
||||
{
|
||||
Reporter::warning(fmt("lookup_addr timeout for %s", rec$id$resp_h));
|
||||
Log::delay_finish(id, rec, token2);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue