Skip to content

Instantly share code, notes, and snippets.

@amcginlay
Last active November 12, 2019 21:39
Show Gist options
  • Save amcginlay/a958520ba1803feb49a6d6f2e84097ff to your computer and use it in GitHub Desktop.
Save amcginlay/a958520ba1803feb49a6d6f2e84097ff to your computer and use it in GitHub Desktop.
AWS CLI command to dump the contents of a Kinesis stream shard
STREAM_NAME=wildrydes
SHARD_ID=ShardId-000000000000
aws kinesis get-records --shard-iterator $( \
aws kinesis get-shard-iterator \
--stream-name ${STREAM_NAME} \
--shard-id ${SHARD_ID} \
--shard-iterator-type TRIM_HORIZON \
--output text \
) --output text --query 'Records[*].[Data]' | while read line ; do echo $line | base64 --decode ; echo ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment