mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
34 lines
551 B
Bash
Executable file
34 lines
551 B
Bash
Executable file
#! /usr/bin/env bash
|
|
#
|
|
# A diff canonifier that removes all file IDs from files.log
|
|
|
|
awk '
|
|
BEGIN {
|
|
FS="\t";
|
|
OFS="\t";
|
|
process = 0;
|
|
}
|
|
|
|
$1 == "#path" && $2 == "files" {
|
|
process = 1;
|
|
}
|
|
|
|
/^[^#]/ {
|
|
if ( process && column1 > 0 && column2 > 0 ) {
|
|
$column1 = "XXXXXXXXXXX";
|
|
$column2 = "XXXXXXXXXXX";
|
|
}
|
|
}
|
|
|
|
/^#fields/ {
|
|
for ( i = 2; i <= NF; ++i ) {
|
|
if ( $i == "fuid" )
|
|
column1 = i - 1;
|
|
|
|
if ( $i == "parent_fuid" )
|
|
column2 = i - 1;
|
|
}
|
|
}
|
|
|
|
{ print }
|
|
'
|