我是JSON的新手。我在AWS Opswork中创建了自定义JSON,并尝试将其作为Chef recipe的属性进行访问,但不幸的是它没有捕获JSON值。我的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']
但它失败了,我也尝试没有“正常”。我得到了一些[]空类错误。
你也许是男人_filebeat_而不是_filbeat_? – StephenKing