Ask Your Question

Revision history [back]

I don't think you can do this without further processing, but you can change the output format to value:

openstack server show INSTANCENAME -c addresses -f value | cut -f2 -d=

The above assumes that there is a single IPv4 address and no IPv6 address.

You can also use output format json and pipe the output into a parser like jq. Output formats shell and yaml might also be interesting.

FInally, you could submit the API request with curl and, again, use jq to parse it.