zeek/testing/btest/scripts/base/frameworks/logging/writer-path-conflict.zeek
Robin Sommer 789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00

24 lines
1,013 B
Text

# @TEST-EXEC: zeek -C -r $TRACES/wikipedia.trace %INPUT
# @TEST-EXEC: btest-diff reporter.log
# @TEST-EXEC: btest-diff http.log
# @TEST-EXEC: btest-diff http-2.log
# @TEST-EXEC: btest-diff http-3.log
# @TEST-EXEC: btest-diff http-2-2.log
@load base/protocols/http
event zeek_init()
{
# Both the default filter for the http stream and this new one will
# attempt to have the same writer write to path "http", which will
# be reported as a warning and the path auto-corrected to "http-2"
local filter: Log::Filter = [$name="host-only", $include=set("host")];
# Same deal here, but should be auto-corrected to "http-3".
local filter2: Log::Filter = [$name="uri-only", $include=set("uri")];
# Conflict between auto-correct paths needs to be corrected, too, this
# time it will be "http-2-2".
local filter3: Log::Filter = [$path="http-2", $name="status-only", $include=set("status_code")];
Log::add_filter(HTTP::LOG, filter);
Log::add_filter(HTTP::LOG, filter2);
Log::add_filter(HTTP::LOG, filter3);
}