Article 5FSSX How to use awk or sed to strip characters from curl command.

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.34latest?d=yIl2AUoC8zA latest?i=83GND65Wsvs:VspzRjq_jsw:F7zBnMy latest?i=83GND65Wsvs:VspzRjq_jsw:V_sGLiP latest?d=qj6IDK7rITs latest?i=83GND65Wsvs:VspzRjq_jsw:gIN9vFw83GND65Wsvs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments