mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Removing location information from ssh.log in external tests.
This commit is contained in:
parent
18ba9a1626
commit
1164fdfb46
3 changed files with 42 additions and 1 deletions
|
@ -8,6 +8,10 @@ if [ "$1" == "capture_loss.log" ]; then
|
|||
addl="`dirname $0`/diff-remove-fractions"
|
||||
fi
|
||||
|
||||
if [ "$1" == "ssh.log" ]; then
|
||||
addl="`dirname $0`/diff-remove-fields remote_location"
|
||||
fi
|
||||
|
||||
`dirname $0`/diff-remove-timestamps \
|
||||
| `dirname $0`/diff-remove-uids \
|
||||
| `dirname $0`/diff-remove-file-ids \
|
||||
|
|
34
testing/scripts/diff-remove-fields
Executable file
34
testing/scripts/diff-remove-fields
Executable file
|
@ -0,0 +1,34 @@
|
|||
#! /usr/bin/env bash
|
||||
#
|
||||
# A diff canonifier that removes all fields starting with a given
|
||||
# prefix.
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo "usage: `basename $0` <field prefix>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
awk -v "PREFIX=$1" '
|
||||
|
||||
BEGIN { FS="\t"; OFS="\t"; }
|
||||
|
||||
/^#fields/ {
|
||||
for ( i = 2; i <= NF; ++i )
|
||||
{
|
||||
if ( index($i, PREFIX) == 1 )
|
||||
rem[i-1] = 1;
|
||||
}
|
||||
print;
|
||||
next;
|
||||
}
|
||||
|
||||
{
|
||||
for ( i in rem )
|
||||
# Mark that it iss set, but ignore content.
|
||||
$i = "+";
|
||||
|
||||
print;
|
||||
}
|
||||
|
||||
'
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue