amazon-web-services - CLI将数据放入AWS Firehose

标签 amazon-web-services aws-cli amazon-kinesis-firehose

AWS Firehose已于今天发布。我正在研究它,并试图弄清楚如何使用AWS CLI将数据放入流中。我有一个简单的JSON有效负载和对应的Redshift表,其中的列映射到JSON属性。我尝试了各种组合,但似乎无法通过cli传递JSON有效负载。

我尝试过的

aws firehose put-record --delivery-stream-name test-delivery-stream --record '{ "attribute": 1 }'

aws firehose put-record --delivery-stream-name test-delivery-stream --record { "attribute": 1 }

aws firehose put-record --delivery-stream-name test-delivery-stream --record Data='{ "attribute": 1 }'

aws firehose put-record --delivery-stream-name test-delivery-stream --record Data={ "attribute": 1 }

aws firehose put-record --delivery-stream-name test-delivery-stream --cli-input-json '{ "attribute": 1 }'

aws firehose put-record --delivery-stream-name test-delivery-stream --cli-input-json { "attribute": 1 }

我看了对cli的帮助并没有帮助。 This article已于今天发布,但由于参数“--firehose-name”已由“--delivery-stream-name”代替,因此它们使用的命令似乎已过时。

最佳答案

在Blob中的键和值周围转义双引号:

aws firehose put-record --delivery-stream-name test-delivery-stream --record '{"Data":"{\"attribute\":1}"}'

关于amazon-web-services - CLI将数据放入AWS Firehose,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33006303/

相关文章:

amazon-web-services - 如何查看 CloudWatch 日志流背后的 IP 地址

json - 从 kinesis firehose 解析 json

amazon-web-services - AWS Kinesis Firehose到Redshift的记录应如何格式化?

amazon-web-services - 使用 ec2-describe-tags 时如何获取仅运行实例的列表

amazon-web-services - 如何从命令行找出当前实例的名称?

python - AWS IoT 和带有 paho-mqtt 的 Raspberry Pi 无法连接

amazon-web-services - aws s3api put-bucket-website - PutBucketWebsite 操作 : Access Denied

c# - 从在已分配 IAM 角色的 Amazon EC2 实例上运行的 C# .NET 应用程序为联合用户创建 STS token

python - Ansible ec2.py 不工作

aws-lambda - 使用 SAM 转换从 aws cli 更新 cloudformation 堆栈