fix LOSS calc line

This commit is contained in:
m0duspwnens
2020-10-09 11:54:39 -04:00
parent 3f007b6af7
commit ea1324e498

View File

@@ -18,7 +18,7 @@ if [ -f "$ZEEKLOG" ]; then
if [ -f "$LASTCAPTURELOSSLOG" ]; then
LASTTS=$(cat $LASTCAPTURELOSSLOG)
if [[ "$LASTTS" != "$CURRENTTS" ]]; then
LOSS=$(tail -$WORKERS $ZEEKLOG | awk -F, '{print $NF}' | sed 's/}//' | awk -F: '{LOSS += $2 / $WORKERS END { print LOSS}')
LOSS=$(tail -$WORKERS $ZEEKLOG | awk -F, '{print $NF}' | sed 's/}//' | awk -v WORKERS=$WORKERS -F: '{LOSS += $2 / WORKERS} END { print LOSS}')
echo "zeekcaptureloss loss=$LOSS"
fi
fi