jq [{"name": "apple", "price": 10}, {"name": "orange", "price": 20}] jq '.[] | select(.["name"] | test("oran.*")) | {(.["name"]): .["price"]}' # │ │ │ └─ object construction # │ │ └─ expression keys need to be parenthesized # │ └─ regex match returns boolean # └─ select values where conditional is true {"orange": 20} https://stedolan.github.io/jq/manual/ https://jqplay.org/