zeek/testing/btest/scripts/base/frameworks/analyzer/request-analyzer.zeek
Arne Welzel 4e75d54d49 scripts/analyzer: Introduce Analyzer::requested_analyzers
In certain deployment scenarios, all analyzers are disabled by default.
However, conditionally/optionally loaded scripts may rely on analyzers
functioning and declare a request for them.

Add a global set set to the Analyzer module where external scripts can record
their requirement/request for a certain analyzer. Analyzers found in this
set are enabled at zeek_init() time.
2022-12-13 14:28:16 +01:00

16 lines
485 B
Text

# @TEST-DOC: Ensure only the HTTP analyzer is enabled (filter out some noise from the trace)
# @TEST-EXEC: zeek -b -f 'port 53 or port 80' -r ${TRACES}/wikipedia.trace %INPUT
# @TEST-EXEC: btest-diff conn.log
# @TEST-EXEC: btest-diff http.log
# @TEST-EXEC: test ! -f dns.log
@load base/protocols/conn
@load base/protocols/dns
@load base/protocols/http
# Turn all analyzers off.
redef Analyzer::disable_all = T;
redef Analyzer::requested_analyzers += {
Analyzer::ANALYZER_HTTP,
};