-
-
Save radut/517fa6a083f1a44b488912c23cae6fd0 to your computer and use it in GitHub Desktop.
dig results to parsable json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo=$(dig google.com +nocomments +noquestion +noauthority +noadditional +nostats | awk '{if (NR>3){print}}'| jq -R 'split("\t") |{Name:.[0],TTL:.[2],Class:.[3],Type:.[4],IpAddress:.[5]}' | jq --slurp .) | jq -n --argjson v $foo '{"foo": $v}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment