Last active
August 27, 2017 16:53
-
-
Save xTNTx/718e3f7fb37237fadae3e0916bf5b38e to your computer and use it in GitHub Desktop.
jq cheetsheet
This file contains 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
# Get most common errors sorted descending | |
cat input \ | |
| jq '. | select(.level | contains("info") | not)' \ | |
| jq -C -s 'group_by(.msg) | map({msg: .[0].msg, amount: . | length, hosts: [.[].host] | unique}) | sort_by(.amount) | reverse' | |
| less -R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment