I would like to call another command inside of jq query.
For example,
{
hostA: "somedomain.com",
hostB: "anotherdomain.com"
}
I need to transform to:
{
hostA: "123.123.123.123",
hostB: "132.132.132.132"
}
Applying this command on every value:
dig +short $value
So, each host is transformed to IP.
Or, bash, iterate over result, reconstruct json only?
If so, what is the easiest/cleanest solution? I see it as I have to recreate second, mapping json and apply solutions from jq, lookup 1 or jq, lookup 2. Still, looks like a brute force solution.