[
{
"_class": "hudson.model.FreeStyleProject",
"name": "actual_build",
"url": "http://tepl.tallycloudinfra.com:8080/job/actual_build/",
"color": "blue",
"fullname": "actual_build"
},
{
"_class": "hudson.model.FreeStyleProject",
"name": "CIS_TEPL_QA_Deploy",
"url": "http://tepl.tallycloudinfra.com:8080/job/CIS_TEPL_QA_Deploy/",
"color": "blue",
"fullname": "CIS_TEPL_QA_Deploy"
},
{
"_class": "hudson.model.FreeStyleProject",
"name": "cktest",
"url": "http://tepl.tallycloudinfra.com:8080/job/cktest/",
"color": "red",
"fullname": "cktest"
},
{
"_class": "hudson.model.FreeStyleProject",
"name": "Create_New_DB_Structure",
"url": "http://tepl.tallycloudinfra.com:8080/job/Create_New_DB_Structure/",
"color": "blue",
"fullname": "Create_New_DB_Structure"
}
]
I tried below jq command i'm getting this error.
Error:
jq -r '._class[].name' f1.json
jq: error (at f1.json:30): Cannot index array with string "_class"
jq -r '._class.name' f1.json
jq: error (at f1.json:30): Cannot index array with string "_class"
question from:
https://stackoverflow.com/questions/65950072/how-to-get-name-value-in-the-below-json-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…