jq error while parsing json file inside jenkins Shell
jq error while parsing json file inside jenkins Shell I want to parse the value of the filepath from the json. while parsing it via jq and seeing issue with respect to not defined at top level. Please find the json details and the error below: "environment":{ "stage":{ "testing":[ { "tag":"1.0" "filepath":"C:/test/conf" "hostname":"test" }]}} **command Used in Execute shell:** jq -r ".'environment.stage.testing.filePath' env.json **Error Faced**: jq: error: environments/0 is not defined at <top-level>, line 1: environment.stage.testing.filePath jq: 1 compile error TIA 2 Answers 2 The posted data conforms with the requirements of HJSON, and can be converted to JSON by: hjson -j The jq filter includes .filePath whereas the HJSON only includes a key n...
