zeek/doc/frameworks/logging/delay1.zeek
Tim Wojtulewicz adce4e604a Copy docs into Zeek repo directly
This is based on commit 99e6942efec5feff50523f6b2a1f5868f19ab638 from the
zeek-docs repo.
2025-10-13 11:06:48 -07:00

37 lines
869 B
Text

@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);
}
}