mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00

Conflicts: scripts/base/frameworks/cluster/setup-connections.bro scripts/base/frameworks/metrics/main.bro scripts/base/frameworks/notice/actions/email_admin.bro scripts/base/frameworks/notice/weird.bro scripts/base/protocols/mime/file-hash.bro scripts/base/protocols/mime/file-ident.bro scripts/policy/frameworks/communication/listen-clear.bro scripts/policy/frameworks/communication/listen-ssl.bro scripts/policy/frameworks/control/controller.bro scripts/policy/frameworks/metrics/http-example.bro scripts/policy/frameworks/metrics/ssl-example.bro scripts/policy/protocols/conn/scan.bro src/CMakeLists.txt
22 lines
605 B
Text
22 lines
605 B
Text
@load base/frameworks/metrics/main
|
|
@load base/utils/site
|
|
|
|
redef enum Metrics::ID += {
|
|
CONNS_ORIGINATED,
|
|
CONNS_RESPONDED
|
|
};
|
|
|
|
event bro_init()
|
|
{
|
|
Metrics::add_filter(CONNS_ORIGINATED, [$aggregation_mask=24, $break_interval=1mins]);
|
|
|
|
# Site::local_nets must be defined in order for this to actually do anything.
|
|
Metrics::add_filter(CONNS_RESPONDED, [$aggregation_table=Site::local_nets_table, $break_interval=1mins]);
|
|
}
|
|
|
|
event connection_established(c: connection)
|
|
{
|
|
Metrics::add_data(CONNS_ORIGINATED, [$host=c$id$orig_h], 1);
|
|
Metrics::add_data(CONNS_RESPONDED, [$host=c$id$resp_h], 1);
|
|
}
|
|
|