I have a JSON input:
{
  "policyItems": [
    {
      "accesses": [
        {
          "type": "submit-app",
          "isAllowed": true
        }
      ],
      "users": [],
      "groups": [
        "Application_Team_1",
        "team2"
      ],
      "conditions": [],
      "delegateAdmin": false
    }
  ]
}
I did a command line curl to dispaly the queue policy yarn:
curl  -u "login:password" http://myHost:6080/service/public/v2/api/service/YARN_Cluster/policy/YARN%20NameQueue/
It works fine.
Then I added grep to extract all the list of groups items:
curl  -u "login:password" http://myHost:6080/service/public/v2/api/service/YARN_Cluster/policy/YARN%20NameQueue/ | 
grep -oP '(?<="groups": ")[^"]*'
This following is the result:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   579    0   579    0     0   4384      0 --:--:-- --:--:-- --:--:--  4419
It is not working. How can I do it using grep and not jq ?
 
    