mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00

- Scripts now use the full path for @load to remove the subpaths from the shipped BROPATH. - Some script sets have been reorganized to make optional loads more obvious.
19 lines
No EOL
467 B
Text
19 lines
No EOL
467 B
Text
@load frameworks/metrics
|
|
|
|
redef enum Metrics::ID += {
|
|
CONNS_ORIGINATED,
|
|
CONNS_RESPONDED
|
|
};
|
|
|
|
event bro_init()
|
|
{
|
|
Metrics::configure(CONNS_ORIGINATED, [$aggregation_mask=24, $break_interval=5mins]);
|
|
Metrics::configure(CONNS_RESPONDED, [$aggregation_mask=24, $break_interval=5mins]);
|
|
}
|
|
|
|
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);
|
|
}
|
|
|