New script for logging header names and values.

- Closes #519.
This commit is contained in:
Seth Hall 2011-09-13 22:33:26 -04:00
parent af6c7c8b1a
commit f32b567c85

View file

@ -1,4 +1,6 @@
##! Extract and include the header keys used for each request in the log.
##! Extract and include the header names used for each request in the HTTP
##! logging stream. The headers in the logging stream will be stored in the
##! same order which they were seen on the wire.
@load base/protocols/http/main
@ -8,15 +10,13 @@ export {
redef record Info += {
## The vector of HTTP headers. No header values are included here, just
## the header names.
## TODO: with an empty vector as &default, the vector isn't coerced to the
## correct type.
headers: vector of string &log &optional;
};
}
event http_header(c: connection, is_orig: bool, name: string, value: string) &priority=4
event http_header(c: connection, is_orig: bool, name: string, value: string) &priority=3
{
if ( ! is_orig )
if ( ! is_orig || ! c?$http )
return;
if ( ! c$http?$headers )