mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Change the standalone sumstats mode to work incrementally.
This commit is contained in:
parent
8061a34b3e
commit
af36915186
3 changed files with 39 additions and 11 deletions
|
@ -1,5 +1,8 @@
|
|||
# @TEST-EXEC: bro %INPUT
|
||||
# @TEST-EXEC: btest-diff .stdout
|
||||
# @TEST-EXEC: btest-bg-run standalone bro %INPUT
|
||||
# @TEST-EXEC: btest-bg-wait 5
|
||||
# @TEST-EXEC: btest-diff standalone/.stdout
|
||||
|
||||
redef exit_only_after_terminate=T;
|
||||
|
||||
event bro_init() &priority=5
|
||||
{
|
||||
|
@ -19,8 +22,9 @@ event bro_init() &priority=5
|
|||
{
|
||||
local r = result["test.metric"];
|
||||
print fmt("Host: %s - num:%d - sum:%.1f - var:%.1f - avg:%.1f - max:%.1f - min:%.1f - std_dev:%.1f - unique:%d - hllunique:%d", key$host, r$num, r$sum, r$variance, r$average, r$max, r$min, r$std_dev, r$unique, r$hll_unique);
|
||||
terminate();
|
||||
}
|
||||
]);
|
||||
])
|
||||
|
||||
SumStats::observe("test.metric", [$host=1.2.3.4], [$num=5]);
|
||||
SumStats::observe("test.metric", [$host=1.2.3.4], [$num=22]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue