title: How to extract the string based on the value from another field?
body: <p>Please consider the following JSON in <code>packer_manifest.json</code>:</p>
  
  <pre><code>{
    "builds": [
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1490743286,
        "files": null,
        "artifact_id": "us-east-1:ami-ae4af3b8",
        "packer_run_uuid": "76afaf47-2ac2-8b50-da43-ea5bff541ae6"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1490744203,
        "files": null,
        "artifact_id": "us-east-1:ami-994ff68f",
        "packer_run_uuid": "d5655333-4240-bbf5-8b08-94be7606536d"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1490744956,
        "files": null,
        "artifact_id": "us-east-1:ami-e241f8f4",
        "packer_run_uuid": "5f7efb09-4b45-9239-ffe6-903a0aed26e4"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1490745669,
        "files": null,
        "artifact_id": "us-east-1:ami-4046ff56",
        "packer_run_uuid": "69fd6d30-fdfd-6778-54ac-338abbea2d88"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1490746077,
        "files": null,
        "artifact_id": "us-east-1:ami-dc3b82ca",
        "packer_run_uuid": "4c74241d-f7e2-bdad-6fa7-3fb84e56c9b3"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1490806537,
        "files": null,
        "artifact_id": "us-east-1:ami-2c4cf43a",
        "packer_run_uuid": "afcbe826-1a0a-7042-35cb-3e3c2569b48b"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1491921968,
        "files": null,
        "artifact_id": "us-east-1:ami-69a8207f",
        "packer_run_uuid": "57ad32f1-6291-7a60-5ee9-3bf46aacd288"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1491940019,
        "files": null,
        "artifact_id": "us-east-1:ami-035ad215",
        "packer_run_uuid": "a0124439-8002-9d13-59bf-43fdcef6eb5e"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1491940543,
        "files": null,
        "artifact_id": "us-east-1:ami-7e5fd768",
        "packer_run_uuid": "42a0f104-460f-789a-6a86-37ea6b9fbf93"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1491941479,
        "files": null,
        "artifact_id": "us-east-1:ami-0252da14",
        "packer_run_uuid": "13fd9737-e41f-ce82-b991-b363fae971b5"
      },
      {
        "name": "amazon-ebs",
        "builder_type": "amazon-ebs",
        "build_time": 1492026265,
        "files": null,
        "artifact_id": "us-east-1:ami-a3159eb2",
        "packer_run_uuid": "83d55673-620e-05ee-2983-24cab0a009d5"
      }
    ],
    "last_run_uuid": "83d55673-620e-05ee-2983-24cab0a009d5"
  }
  </code></pre>
  
  <p>I am trying to extract the string <code>us-east-1:ami-a3159eb2</code> only using <code>jq</code>.</p>
  
  <p>I would imagine I need to execute something like this:</p>
  
  <pre><code>jq -r '. | .builds[].artifact_id(where "packer_run_uuid" == .last_run_uuid)'
  </code></pre>