title: How to filter JSON data in Ansible?
body: <p>I'm querying an API with Ansible <code>command</code>'s command. The API returns a JSON object with network information.</p>
  
  <p>I'd like to get a server's private ip based on its public ip. I know this is possible with <a href="http://docs.ansible.com/ansible/latest/playbooks_filters.html#json-query-filter" rel="nofollow noreferrer">JSON query filter</a> but I can't figure out how.</p>
  
  <p>The code:</p>
  
  <pre><code>- name: Get RPN topology
    command: 'curl -X GET -H "Authorization: Bearer {{ onlineApiToken }}" "https://api.online.net/api/v1/rpn/group"'
    register: RPN
    delegate_to: 127.0.0.1
  </code></pre>
  
  <p>This is what <code>RPN.stdout</code> output looks like:</p>
  
  <pre><code>    TASK [debug] ****************************************************************************************
  ok: [ps1] =&gt; {
      "changed": false, 
      "msg": [
          {
              "id": 7406, 
              "members": [
                  {
                      "id": 0000, 
                      "ip": "x.x.x.x", 
                      "owner": "buzut", 
                      "private_ip": "10.91.154.39", 
                      "speed": 100, 
                      "status": "active"
                  }, 
                  {
                      "id": 1111, 
                      "ip": "y.y.y.y", 
                      "owner": "buzut", 
                      "private_ip": "10.91.120.148", 
                      "speed": 100, 
                      "status": "active"
                  }, 
                  {
                      "id": 2222, 
                      "ip": "z.z.z.z", 
                      "owner": "buzut", 
                      "private_ip": "10.91.165.215", 
                      "speed": 1000, 
                      "status": "active"
                  }
              ], 
              "name": "MySQL", 
              "owner": "buzut", 
              "shared": false, 
              "status": "updating"
          }
      ]
  }
  </code></pre>
  
  <p>The question: how do I get a server's private ip, based on its public one?</p>