简体   繁体   English

Kinesis的AWS CLI记录

[英]aws cli put-record for Kinesis

I am trying to write some data to AWS Kinesis with the CLI, but this isn't working: 我正在尝试使用CLI将一些数据写入AWS Kinesis,但这是行不通的:

aws kinesis put-record --stream-name my-stream-name --data Data=jose|12

I am getting a "bash: 12: command not found" error. 我收到“ bash:12:找不到命令”错误。

aws kinesis put-record help works so I don't understand the error. aws kinesis put-record help有效,因此我不理解该错误。

I'm following this documentation . 我正在关注本文档

Just wrap your data with single quotes: 只需用单引号将数据包装起来即可:

--data 'Data=jose|12'

otherwise bash will try to pipe the output of aws kinesis put-record --stream-name my-stream-name --data Data=jose to a program called 12 , which does not exist. 否则bash会尝试将aws kinesis put-record --stream-name my-stream-name --data Data=jose传递给名为12的程序,该程序不存在。

You will also need to add the --partition-key argument, which you can randomly generate using --partition-key `uuidgen` . 您还需要添加--partition-key参数,您可以使用--partition-key `uuidgen`随机生成。 The whole command will be: 整个命令将是:

aws kinesis put-record --stream-name my-stream-name --data 'Data=jose|12' --partition-key `uuidgen`

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM