mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This is based on commit 2731def9159247e6da8a3191783c89683363689c from the zeek-docs repo.
19 lines
880 B
Text
19 lines
880 B
Text
event http_request(c: connection, method: string, original_URI: string, unescaped_URI: string, version: string) &group="http-print-debugging"
|
|
{
|
|
print fmt("HTTP request: %s %s (%s->%s)", method, original_URI, c$id$orig_h, c$id$resp_h);
|
|
}
|
|
|
|
event http_header(c: connection, is_orig: bool, original_name: string, name: string, value: string) &group="http-print-debugging"
|
|
{
|
|
if ( name != "USER-AGENT" && name != "SERVER" )
|
|
return;
|
|
|
|
local snd = is_orig ? c$id$orig_h : c$id$resp_h;
|
|
local rcv = is_orig ? c$id$resp_h : c$id$orig_h;
|
|
print fmt("HTTP header : %s=%s (%s->%s)", original_name, value, snd, rcv);
|
|
}
|
|
|
|
event http_reply(c: connection, version: string, code: count, reason: string) &group="http-print-debugging"
|
|
{
|
|
print fmt("HTTP reply: %s/%s version %s (%s->%s)", code, reason, version, c$id$resp_h, c$id$orig_h);
|
|
}
|