Skip to content

Instantly share code, notes, and snippets.

@FrankHassanabad
Created January 14, 2020 23:10
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 FrankHassanabad/bbe866cfdcd446ed000baef92c6bbfe1 to your computer and use it in GitHub Desktop.
Save FrankHassanabad/bbe866cfdcd446ed000baef92c6bbfe1 to your computer and use it in GitHub Desktop.
Sorts JSON keys using jq
#!/bin/sh
mkdir sorted
for f in ~/projects/kibana/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/*.json ; do
echo $f
cat $f | jq . -S > sorted/$(basename -- "$f" .json).json
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment