Remove LogAscii::logdir (6.1 deprecation)

This commit is contained in:
Tim Wojtulewicz 2023-06-02 11:05:35 +02:00 committed by Tim Wojtulewicz
parent 0110c15ee2
commit 531276cfe0
9 changed files with 26 additions and 113 deletions

View file

@ -1,6 +1,6 @@
#
# @TEST-EXEC: mkdir logdir
# @TEST-EXEC: zeek -b %INPUT LogAscii::logdir=logdir
# @TEST-EXEC: zeek -b %INPUT Log::default_logdir=logdir
# @TEST-EXEC: cat logdir/ssh.log | grep -v PREFIX.*20..- >ssh-filtered.log
# @TEST-EXEC: btest-diff ssh-filtered.log

View file

@ -1,34 +0,0 @@
# @TEST-DOC: Test that .shadow files are picked up from LogAscii::logdir.
# @TEST-EXEC: mkdir logs
# @TEST-EXEC: echo ".log" >> logs/.shadow.conn.log
# @TEST-EXEC: echo "my_rotation_postprocessor" >> logs/.shadow.conn.log
# @TEST-EXEC: echo "leftover conn log" > logs/conn.log
# @TEST-EXEC: echo ".log" >> logs/.shadow.dns.log
# @TEST-EXEC: echo "my_rotation_postprocessor" >> logs/.shadow.dns.log
# @TEST-EXEC: echo "leftover dns log" > logs/dns.log
# @TEST-EXEC: zeek -b %INPUT > out
# @TEST-EXEC: ! test -f logs/.shadow.conn.log
# @TEST-EXEC: ! test -f logs/conn.log
# @TEST-EXEC: ! test -f logs/.shadow.dns.log
# @TEST-EXEC: ! test -f logs/dns.log
# Ensure rotated logs ends-up in the current working directory: This may change in the future.
# @TEST-EXEC: cat ./conn-*.log ./dns-*.log > logs.cat
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff out
# @TEST-EXEC: btest-diff logs.cat
module GLOBAL;
function my_rotation_postprocessor(info: Log::RotationInfo) : bool
{
print fmt("running my rotation postprocessor for path '%s'", info$path);
return T;
}
redef LogAscii::logdir = "./logs";
redef LogAscii::enable_leftover_log_rotation = T;
redef Log::default_rotation_interval = 1hr;
redef Log::default_rotation_postprocessor_cmd = "echo";

View file

@ -1,23 +0,0 @@
# @TEST-DOC: Test that stale .shadow files are removed from LogAscii::logdir.
# @TEST-EXEC: mkdir logs
# @TEST-EXEC: echo ".log" >> logs/.shadow.conn.log
# @TEST-EXEC: echo "my_rotation_postprocessor" >> logs/.shadow.conn.log
# @TEST-EXEC: zeek -b %INPUT > out 2>&1
# @TEST-EXEC: ! test -f logs/.shadow.conn.log
# @TEST-EXEC: TEST_DIFF_CANONIFIER='$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps' btest-diff out
module GLOBAL;
function my_rotation_postprocessor(info: Log::RotationInfo) : bool
{
print fmt("running my rotation postprocessor for path '%s'", info$path);
return T;
}
redef LogAscii::logdir = "./logs";
redef LogAscii::enable_leftover_log_rotation = T;
redef Log::default_rotation_interval = 1hr;
redef Log::default_rotation_postprocessor_cmd = "echo";

View file

@ -2,7 +2,7 @@
# @TEST-EXEC: mkdir logs
# @TEST-EXEC: zeek -b -r ${TRACES}/rotation.trace %INPUT >zeek.out 2>&1
# @TEST-EXEC: grep "test" zeek.out | sort >out
# @TEST-EXEC: for i in `ls test.*.log | sort`; do printf '> %s\n' $i; cat $i; done >>out
# @TEST-EXEC: for i in `ls logs/test.*.log | sort`; do printf '> %s\n' $i; cat $i; done >>out
# @TEST-EXEC: TEST_DIFF_CANONIFIER='$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps' btest-diff out
module Test;
@ -19,8 +19,8 @@ export {
} &log;
}
redef LogAscii::logdir = "./logs";
redef LogAscii::enable_leftover_log_rotation = T;
redef Log::default_logdir = "./logs";
redef Log::default_rotation_interval = 1hr;
redef Log::default_rotation_postprocessor_cmd = "echo";