mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Improve a few test canonifiers
This commit is contained in:
parent
8a16145e31
commit
a7aa393aef
3 changed files with 21 additions and 19 deletions
|
@ -4,8 +4,8 @@
|
|||
# prefix.
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo "usage: `basename $0` <field prefix>"
|
||||
exit 1
|
||||
echo "usage: `basename $0` <field prefix>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
awk -v "PREFIX=$1" '
|
||||
|
@ -18,17 +18,15 @@ BEGIN { FS="\t"; OFS="\t"; }
|
|||
if ( index($i, PREFIX) == 1 )
|
||||
rem[i-1] = 1;
|
||||
}
|
||||
print;
|
||||
next;
|
||||
}
|
||||
|
||||
/^[^#]/ {
|
||||
for ( i in rem )
|
||||
# Mark that it is set, but ignore content.
|
||||
$i = "+";
|
||||
}
|
||||
|
||||
{
|
||||
for ( i in rem )
|
||||
# Mark that it iss set, but ignore content.
|
||||
$i = "+";
|
||||
|
||||
print;
|
||||
}
|
||||
|
||||
'
|
||||
|
||||
|
|
|
@ -13,13 +13,15 @@ $1 == "#path" && $2 == "files" {
|
|||
process = 1;
|
||||
}
|
||||
|
||||
process && column1 > 0 && column2 > 0 {
|
||||
$column1 = "XXXXXXXXXXX";
|
||||
$column2 = "XXXXXXXXXXX";
|
||||
/^[^#]/ {
|
||||
if ( process && column1 > 0 && column2 > 0 ) {
|
||||
$column1 = "XXXXXXXXXXX";
|
||||
$column2 = "XXXXXXXXXXX";
|
||||
}
|
||||
}
|
||||
|
||||
/^#/ {
|
||||
for ( i = 0; i < NF; ++i ) {
|
||||
/^#fields/ {
|
||||
for ( i = 2; i <= NF; ++i ) {
|
||||
if ( $i == "fuid" )
|
||||
column1 = i - 1;
|
||||
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
awk '
|
||||
BEGIN { FS="\t"; OFS="\t"; }
|
||||
|
||||
column > 0 {
|
||||
$column = "XXXXXXXXXXX";
|
||||
/^[^#]/ {
|
||||
if ( column > 0 ) {
|
||||
$column = "XXXXXXXXXXX";
|
||||
}
|
||||
}
|
||||
|
||||
/^#/ {
|
||||
for ( i = 0; i < NF; ++i ) {
|
||||
/^#fields/ {
|
||||
for ( i = 2; i <= NF; ++i ) {
|
||||
if ( $i == "uid" )
|
||||
column = i - 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue