title: How to produce a single line output of a record with jq
body: <p>I have the following JSON </p>
  
  <pre>
  
  {
     "guid": "dce38b4b-9989-42d2-b6bd-702645e344cf",
     "name": "dev",
     "apps": [
        {
           "guid": "5d5498cb-a885-4242-a55a-d7d286a1cf48",
           "urls": [
              "nodered.cloudfoundry.org"
           ],
           "routes": [
              {
                 "guid": "aca4d04b-f99d-4b43-afaa-82ab41afa07c",
                 "host": "nodered-test",
                 "port": null,
                 "path": "",
                 "domain": {
                    "guid": "f4b90d7e-2cd3-4d30-b200-f28bbaf6be20",
                    "name": "cloudfoundry.org"
                 }
              }
           ],
           "service_count": 1,
           "service_names": [
              "nodered-test-cloudantNoSQLDB"
           ],
           "running_instances": 1,
           "name": "perik-nodered-test",
           "production": false,
           "space_guid": "dce38b4b-9989-42d2-b6bd-702645e344cf",
           "stack_guid": "ac91d31a-86a3-453b-babf-8d49c9d763fc",
           "buildpack": null,
           "detected_buildpack": "SDK for Node.js(TM) (ibm-node.js-6.13.0, buildpack-v3.20-20180403-1426)",
           "detected_buildpack_guid": "33e9e82f-8846-4362-a60a-92964285a31e",
           "environment_json": {},
           "memory": 256,
           "instances": 1,
           "disk_quota": 1024,
           "state": "STARTED",
           "version": "8c8c97a0-bc2e-424c-a0a3-d64704feb634",
           "command": null,
           "console": false,
           "debug": null,
           "staging_task_id": "539f460c-e4d2-49f9-b5e5-9f4fd31a8370",
           "package_state": "STAGED",
           "health_check_type": "port",
           "health_check_timeout": null,
           "health_check_http_endpoint": null,
           "staging_failed_reason": null,
           "staging_failed_description": null,
           "diego": true,
           "docker_image": null,
           "package_updated_at": "2018-04-10T17:32:06Z",
           "detected_start_command": "./vendor/initial_startup.rb",
           "enable_ssh": true,
           "ports": null
        },
        {
           "guid": "4089ce19-19fb-467b-8876-3635819d5d91",
           "urls": [
              "nodered.cloudfoundry.org"
           ],
           "routes": [
              {
                 "guid": "b79988d8-5ac5-455d-8fdd-00bc208dd2bc",
                 "host": "NodeRedTestApp",
                 "port": null,
                 "path": "",
                 "domain": {
                    "guid": "f4b90d7e-2cd3-4d30-b200-f28bbaf6be20",
                    "name": "cloudfoundry.org"
                 }
              }
           ],
           "service_count": 1,
           "service_names": [
              "NodeRedTestApp-cloudantNoSQLDB"
           ],
           "running_instances": 1,
           "name": "perik-NodeRedTestApp",
           "production": false,
           "space_guid": "dce38b4b-9989-42d2-b6bd-702645e344cf",
           "stack_guid": "ac91d31a-86a3-453b-babf-8d49c9d763fc",
           "buildpack": null,
           "detected_buildpack": "SDK for Node.js(TM) (ibm-node.js-6.13.0, buildpack-v3.20-20180403-1426)",
           "detected_buildpack_guid": "33e9e82f-8846-4362-a60a-92964285a31e",
           "environment_json": {},
           "memory": 256,
           "instances": 1,
           "disk_quota": 1024,
           "state": "STARTED",
           "version": "17175bdb-df93-4745-9a17-cf214fe05976",
           "command": null,
           "console": false,
           "debug": null,
           "staging_task_id": "5c74633a-25db-4adf-9eb8-09454a70be52",
           "package_state": "STAGED",
           "health_check_type": "port",
           "health_check_timeout": null,
           "health_check_http_endpoint": null,
           "staging_failed_reason": null,
           "staging_failed_description": null,
           "diego": true,
           "docker_image": null,
           "package_updated_at": "2018-04-09T21:23:27Z",
           "detected_start_command": "./vendor/initial_startup.rb",
           "enable_ssh": true,
           "ports": null
        }
     ]
  
  }
  </pre>
  
  <p>and getting the following values using </p>
  
  <p>cat test.json | jq -r '.apps[].routes[].host, .apps[].state, .apps[].package_updated_at' which produces the following output</p>
  
  <p>nodered-test<br>
  NodeRedTestApp<br>
  STARTED<br>
  STARTED<br>
  2018-04-10T17:32:06Z<br>
  2018-04-09T21:23:27Z<br></p>
  
  <p>How can I get the output as</p>
  
  <p>nodered-test STARTED 2018-04-10T17:32:06Z<br>
  NodeRedTestApp STARTED 2018-04-09T21:23:27Z<br></p>
  
  <p>So that I can assign it to a bash script array. </p>