amazon-web-services - 在下面的 json 输出中使用 jq 时出现解析错误
问题描述
错误:解析错误:':'不是第 2 行第 13 列的对象的一部分
不知道我在哪里做错了有人可以帮助我。
[
"Events": [
{
"InstanceEventId": "instance-event-0d59937288b749b32",
"Code": "system-reboot",
"Description": "The instance is scheduled for a reboot",
"NotAfter": "2019-03-15T22:00:00.000Z",
"NotBefore": "2019-03-14T20:00:00.000Z",
"NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
}
]
]
解决方案
这不是有效的 JSON 删除命名数组“事件”
[
[
{
"InstanceEventId": "instance-event-0d59937288b749b32",
"Code": "system-reboot",
"Description": "The instance is scheduled for a reboot",
"NotAfter": "2019-03-15T22:00:00.000Z",
"NotBefore": "2019-03-14T20:00:00.000Z",
"NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
}
]
]
或删除外部数组
{
"Events": [
{
"InstanceEventId": "instance-event-0d59937288b749b32",
"Code": "system-reboot",
"Description": "The instance is scheduled for a reboot",
"NotAfter": "2019-03-15T22:00:00.000Z",
"NotBefore": "2019-03-14T20:00:00.000Z",
"NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
}
]
}
推荐阅读
- architecture - JAL 在 RISC-V 中的定义是什么?如何使用它?
- install4j - install4j 从云端下载更新信息失败
- amazon-web-services - AWS 上的 Lambda 架构:为批处理层选择数据库
- python - 如何从列表中创建字典
- android - 改造中的动态价值
- c++ - 如何在 C++ 中从文件中读取/写入多个对象?
- adal.js - ADFS 2016 X-Frame-拒绝选项
- python-3.7 - 在 mesa 中从 CSV 导入代理及其属性
- c++ - 如果语句在 C++ 中被忽略
- java - SpringBoot 数据异常处理