Skip to content

Instantly share code, notes, and snippets.

@oshea00
Created April 18, 2022 00:25
Show Gist options
  • Save oshea00/5aac29ead1deb5633c1bf4d33aa1bbbb to your computer and use it in GitHub Desktop.
Save oshea00/5aac29ead1deb5633c1bf4d33aa1bbbb to your computer and use it in GitHub Desktop.
jq example using AWS partiQL
#!/bin/bash
aws dynamodb execute-statement --statement \
"SELECT * FROM SkiLifts" | \
# Json Output
#jq -c '.Items[] | select(.LiftStatus.S=="Open") | { Lift:.Lift.S, LiftStatus:.LiftStatus.S }'
# CSV Values Output
jq -r -c '.Items[] | select(.LiftStatus.S=="Open") | [.Lift.S, .LiftStatus.S ] | @csv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment