Created
March 5, 2018 12:25
-
-
Save miromasat/35bf73c8c47d9020d2ec01da98aa3e47 to your computer and use it in GitHub Desktop.
publish random ruble into kinesis stream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cat <<EOF >/home/ec2-user/kinesis_client.sh | |
#!/bin/sh | |
while true | |
do | |
eventTime=\$(date +"%Y-%m-%d-%T") | |
userId=\$(( ( RANDOM % 100000 ) + 1 )) | |
appId=\$(( ( RANDOM % 1000 ) + 1 )) | |
appScore=\$(( ( RANDOM % 100 ) + 1 )) | |
appData=SomeTestData | |
echo "\$eventTime,\$userId,\$appId,\$appScore,\$appData" | |
aws kinesis put-record --stream-name gleschen_stream --data "\$eventTime,\$userId,\$appId,\$appScore,\$appData"\$'\n' --partition-key \$appId --region us-east-1 | |
done | |
EOF | |
chmod 775 /home/ec2-user/kinesis_client.sh | |
/home/ec2-user/kinesis_client.sh & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment