title: ANSIBLE - Json_Query - Filter result
body: <p>Inside my ansible playbook, I' m trying to filter a json result but for now, it doesn't work.</p>
  
  <p><strong>1/ Playbook</strong><br>
  <em>Below My ansible playbook to query and filter the result:</em></p>
  
  <hr>
  
  <pre><code>tasks:
      - name: "Query Attributes" 
            ...
            ...
        register: query_result
  
      - name: Display Result
        debug: 
          var: query_result  
  
      - name: Display Filtered Result
        debug:
          msg: "{{ query_result.current| json_query('[].context.attributes[?name==`prod`].name') }}" 
  </code></pre>
  
  <p>Maybe an issue inside my json_query filter ?<br>
  Any idea ?     </p>
  
  <hr>
  
  <p><strong>2/ Query_result output before filtering</strong>     </p>
  
  <pre><code>TASK [Display Result] ***************************************************
  "query_result": {
                      "ansible_facts": {
                          "discovered_interpreter_python": "/usr/bin/python"
                      }, 
                      "changed": false, 
                      "current": [
                          {
                              "context": {
                                  "attributes": {
                                      "name": "prod", 
                                      "uid": "11756"
                                  }
                              }
                          }, 
                          {
  ....
                                  }
                              }
                          }, 
                          {
                              "context": {
                                  "attributes": {
                                      "name": "dev", 
                                      "uid": "14424"
                                  }
                              }
                          }
                      ], 
                      "failed": false
                  }
              }
  
  *****************************      
  </code></pre>
  
  <p><strong>3/ Filtered result is empty</strong><br>
  Unfortunately my result is empty.     </p>
  
  <pre><code>    TASK [Display Filtered Result] **********************************************************    
  {    
                  "msg": []    
              }    
  </code></pre>
  
  <p>Thank you<br>
  Ju</p>