Skip to content

Instantly share code, notes, and snippets.

@juneng603
Last active January 23, 2017 05:41
Show Gist options
  • Save juneng603/30ec2e774427b90bc039aea2da45e0a2 to your computer and use it in GitHub Desktop.
Save juneng603/30ec2e774427b90bc039aea2da45e0a2 to your computer and use it in GitHub Desktop.
한줄짜리 kinesis stream iterator
streamname=SmartmenuStreamBeta; aws kinesis describe-stream --stream-name $streamname --output text | grep SHARDS | awk '{print $2}' | while read shard; do aws kinesis get-shard-iterator --stream-name $streamname --shard-id $shard --shard-iterator-type LATEST --output text | while read iterator; do while output=`aws kinesis get-records --shard-iterator $iterator --output text`; do iterator=`echo "$output" | head -n1 | awk '{print $2}'`; echo "$output" | gsed 1d | grep RECORDS | while read record; do echo $record | awk '{print $3}' | base64 -D; echo; done; done; done; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment