mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
33 lines
510 B
Awk
Executable file
33 lines
510 B
Awk
Executable file
#! /usr/bin/awk -f
|
|
#
|
|
# A diff canonifier that removes all file IDs from file_analysis.log
|
|
|
|
BEGIN {
|
|
FS="\t";
|
|
OFS="\t";
|
|
process = 0;
|
|
}
|
|
|
|
$1 == "#path" && $2 == "file_analysis" {
|
|
process = 1;
|
|
}
|
|
|
|
process && column1 > 0 && column2 > 0 {
|
|
$column1 = "XXXXXXXXXXX";
|
|
$column2 = "XXXXXXXXXXX";
|
|
}
|
|
|
|
/^#/ {
|
|
for ( i = 0; i < NF; ++i ) {
|
|
if ( $i == "id" )
|
|
column1 = i - 1;
|
|
|
|
if ( $i == "parent_id" )
|
|
column2 = i - 1;
|
|
}
|
|
}
|
|
|
|
{ print }
|
|
|
|
|
|
|