mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

- Metrics API is much more similar to the Logging framework's API now. - Filters define all output and metrics collection now. - Initial attempt at thresholding and generating notices.
20 lines
No EOL
541 B
Text
20 lines
No EOL
541 B
Text
|
|
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]);
|
|
Metrics::add_data(CONNS_RESPONDED, [$host=c$id$resp_h]);
|
|
}
|
|
|