How to use `jq` to obtain the keys
<p>My json looks like this : </p>

<pre><code>{
  "20160522201409-jobsv1-1": {
    "vmStateDisplayName": "Ready",
    "servers": {
      "20160522201409 jobs_v1 1": {
        "serverStateDisplayName": "Ready",
        "creationDate": "2016-05-22T20:14:22.000+0000",
        "state": "READY",
        "provisionStatus": "PENDING",
        "serverRole": "ROLE",
        "serverType": "SERVER",
        "serverName": "20160522201409 jobs_v1 1",
        "serverId": 2902
      }
    },
    "isAdminNode": true,
    "creationDate": "2016-05-22T20:14:23.000+0000",
    "totalStorage": 15360,
    "shapeId": "ot1",
    "state": "READY",
    "vmId": 4353,
    "hostName": "20160522201409-jobsv1-1",
    "label": "20160522201409 jobs_v1 ADMIN_SERVER 1",
    "ipAddress": "10.252.159.39",
    "publicIpAddress": "10.252.159.39",
    "usageType": "ADMIN_SERVER",
    "role": "ADMIN_SERVER",
    "componentType": "jobs_v1"
  }
}
</code></pre>

<p>My key keeps changing from time to time. So for example <code>20160522201409-jobsv1-1</code> may be something else tomorrow. Also I may more than one such entry in the json payload.</p>

<p>I want to <code>echo $KEYS</code> and I am trying to do it using <code>jq</code>.</p>

<p>Things I have tried : 
<code>| jq .KEYS</code> is the command i use frequently. </p>

<p>Is there a jq command to display all the primary keys in the json?</p>

<p>I only care about the <code>hostname</code> field. And I would like to extract that out. I know how to do it using <code>grep</code> but it is NOT a clean approach.</p>