mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

- Skip diffing of debug.log always. - Skip diffing of reporter.log if it only contains an error about missing GeoIP support. - Canonicalize X.509 Distinguished Name subjects since that can vary depending on installed OpenSSL version.
32 lines
652 B
Awk
Executable file
32 lines
652 B
Awk
Executable file
#! /usr/bin/awk -f
|
|
#
|
|
# A diff canonifier that removes all X.509 Distinguished Name subject fields
|
|
# because that output can differ depending on installed OpenSSL version.
|
|
|
|
BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1 }
|
|
|
|
/^#fields/ {
|
|
for ( i = 2; i < NF; ++i )
|
|
{
|
|
if ( $i == "subject" )
|
|
s_col = i-1;
|
|
if ( $i == "issuer_subject" )
|
|
i_col = i-1;
|
|
}
|
|
}
|
|
|
|
s_col >= 0 {
|
|
if ( $s_col != "-" )
|
|
# Mark that it's set, but ignore content.
|
|
$s_col = "+";
|
|
}
|
|
|
|
i_col >= 0 {
|
|
if ( $i_col != "-" )
|
|
# Mark that it's set, but ignore content.
|
|
$i_col = "+";
|
|
}
|
|
|
|
{
|
|
print;
|
|
}
|