【发布时间】:2016-03-29 17:16:40
【问题描述】:
我是 JSON 新手。我在 AWS Opswork 中创建了自定义 JSON,并尝试将其作为 Chef 配方中的属性进行访问,但不幸的是它没有捕获 JSON 值。我的 JSON 文件看起来像..
{
"normal": {
"filebeat_minjar": {
"log_path" : "/var/log/*.log",
"hosts" : "Some Random Host ID",
"port" : 5000
}
}
}
我正试图在食谱中捕捉它,
log = node['filebeat_minjar']['log_path']
hosts = node['filebeat_minjar']['hosts']
port = node['filebeat_minjar']['port']
但它失败了,我也试过没有'正常'。我得到了一些 []null 类错误。
【问题讨论】:
-
你可以用 filebeat 代替 filbeat 吗?
标签: json chef-infra aws-opsworks