請您與指教:)
幫助我有一個像JSON文件:蟒蛇:篩選複雜的JSON文件
{
content: {
hostname01: {
active_checks_enabled: "1",
current_attempt: "1",
plugin_output: "SSH OK",
services: {
monitoring: {
active_checks_enabled: "0",
current_attempt: "1",
current_state: "0",
downtimes: { },
plugin_output: "PASV MONITORNG OK",
last_check: "1437382990",
problem_has_been_acknowledged: "0",
}
},
comments: { },
last_notification: "0",
max_attempts: "5"
},
我怎麼能格式化這個大的文件,所以我只有像對象:
{
hostname01:{
monitoring: {
current_state: "1"
}
}
}
有兩種可能的current_states:0,1. 預先感謝您!
您的JSON文件無效 - 缺少兩個大括號,並且在有效的JSON'keys'中需要包含在''雙引號'中' – Finwood
考慮設置一個接受的答案,如果它對您的問題有幫助。 – adrianus