#! /usr/bin/env bash
#
# Remove content from "broctl diag" output that is too system-dependent
# (currently, this includes the contents of stdout.log, PATH, bro version,
# and system information).

awk '{
if ( $0 ~ /^==== stdout.log/ ) {
    print; skip=1
} else if ( $0 ~ /^====/ ) {
    print; skip=0
} else if ( $0 ~ /^$/ ) {
    print
} else if ( skip == 0 ) {
    if ( $0 ~ /^PATH=/ ) {
        print "PATH=<...>"
    }
    else if ( $0 ~ /^Bro / ) {
        skip=1
    }
    else {
        print
    }
}
}'
