【发布时间】:2019-10-01 19:54:47
【问题描述】:
我希望使用 bash 浏览一些 kinesis 数据。使用类似 cmd 的命令:
aws kinesis get-records --shard-iterator <long shard info> | jq '[.|.Records[].Data]' | grep \"ey | sed -e 's/^[ \t]*\"//;s/[ \t]*\",$//'
我可以从流中获取 base64 数据。我遇到的问题是通过 base64 进行管道传输,以便查看实际数据。
如果我使用 head -n 和 tail 的组合发送它,我可以看到单个值,但任何超过 2-3 行的尝试都会失败。错误通常是一组 JSON 值,后跟垃圾数据。整个命令通常以
开头输入流中的字符无效。
要查看 json 值,我使用
-- 警告:在 OSX 上使用 bash
【问题讨论】:
标签: bash sed base64 amazon-kinesis