CLI将数据放入AWS Firehose [英] CLI to put data into AWS Firehose

查看:86
本文介绍了CLI将数据放入AWS Firehose的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

AWS Firehose was released today. I'm playing around with it and trying to figure out how to put data into the stream using AWS CLI. I have a simple JSON payload and the corresponding Redshift table with columns that map to the JSON attributes. I've tried various combinations but I can't seem to pass in the JSON payload via the cli.

我尝试过的事情:

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帮助,但没有帮助. 这篇文章已发布今天,但是它们使用的命令似乎已经过时,因为参数"--firehose-name"已由"--delivery-stream-name"代替.

I've looked at the cli help which hasn't helped. This article was published today but looks like the command they use is already outdated as the argument "--firehose-name" has been replaced by "--delivery-stream-name".

推荐答案

在blob内的键和值周围转双引号:

Escape the double-quotes around keys and values inside the blob:

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

这篇关于CLI将数据放入AWS Firehose的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆