# Pastebin PSV7QZwv { FS=",|" gsub(",","") gsub("'","") for(line = 1; line <= NF; ++line) { if ($line ~ /^- ip_address:/) { split($line, word, " ") if (ENVIRON["IPV6_ENABLED"] == "" && word[3] ~ /\./) print word[3] if (ENVIRON["IPV6_ENABLED"] != "" && word[3] ~ /:/) print word[3] } else { split($line, word, " ") for(ind in word) { if (word[ind] ~ /^ip_address=/) { split(word[ind], token, "=") if (ENVIRON["IPV6_ENABLED"] == "" && token[2] ~ /\./) print token[2] if (ENVIRON["IPV6_ENABLED"] != "" && token[2] ~ /:/) print token[2] } } } } }