Created
October 1, 2019 20:32
-
-
Save shcallaway/5a0feee0f834e3141a0a2bffe8286191 to your computer and use it in GitHub Desktop.
Count the number of log lines that contain a field "trace_id"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOTAL=$(cat $1 | wc -l) | |
TOTAL_W_TRACE_ID=$(cat input.csv | awk 'BEGIN { FS = "," } ; { print $5 }' | grep . | wc -l) | |
echo "Total: $TOTAL" | |
echo "Total with trace_id: $TOTAL_W_TRACE_ID" | |
echo "To calculate a percentage, plug these numbers into something that can do floating point arithmetic." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment