How to use awk or sed to strip characters from curl command.
by witchkinkofangmar from LinuxQuestions.org on (#5FSSX)
I'm using this command to get the IP of some servers using the satellite API:
Code:curl -k -u user:password -X GET -H "Accept: application/json" -H "Content-Type: application/json" https://satellite.host.com/api/v2/hosts -d '{"search": "host_collection_id = 3"}' | python -m json.tool |egrep -w "ip"The output is this:
Code: "ip": "10.1.167.29",
"ip": "10.1.167.39",
"ip": "10.1.167.34",How can I use awk or sed to make the output just the IP address like this:
Code:10.1.167.29
10.1.167.39
10.1.167.34


Code:curl -k -u user:password -X GET -H "Accept: application/json" -H "Content-Type: application/json" https://satellite.host.com/api/v2/hosts -d '{"search": "host_collection_id = 3"}' | python -m json.tool |egrep -w "ip"The output is this:
Code: "ip": "10.1.167.29",
"ip": "10.1.167.39",
"ip": "10.1.167.34",How can I use awk or sed to make the output just the IP address like this:
Code:10.1.167.29
10.1.167.39
10.1.167.34