Skip to content

Instantly share code, notes, and snippets.

@xTNTx
Last active August 27, 2017 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xTNTx/718e3f7fb37237fadae3e0916bf5b38e to your computer and use it in GitHub Desktop.
Save xTNTx/718e3f7fb37237fadae3e0916bf5b38e to your computer and use it in GitHub Desktop.
jq cheetsheet
# 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