Forum Discussion
vimal1771_20809
Nimbostratus
Jul 27, 2015F5: Curl command to get Node name from an IP address
Hi,
What curl command should I use to get Node name mapped to Node IP on F5? I have Node IP with me and wants to know Node name.
Is there a curl command to describe node based on IP a...
damian_19221
Nimbostratus
Jul 27, 2015No idea on your second question (it doesn't look like it supports using the IP), but here's a very quick and very dirty answer to the first one:
curl -k -X GET https://admin:PASSWORD@f5adminaddress/mgmt/tm/ltm/node |tr '\,}' '\n' |grep -B5 "your.ip.add.ress"|grep name|awk -F ':' '{print $2}'
- vimal1771_20809Jul 27, 2015
Nimbostratus
Thanks!!! I think using jq is much simpler in that case. curl -k -X GET https://admin:PASSWORD@f5adminaddress/mgmt/tm/ltm/node | jq '.items[] | select(.address==your.ip.add.ress) | .name'
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects