jq: selecting a subset of keys from an object September 7, 2023 by Tarik solution with inside check: jq 'with_entries(select([.key] | inside(["key1", "key2"])))'