I'm trying to get the address from the below result of my nslookup
Here I want to get is the 2nd address which is 10.0.45.45
Server: 10.152.183.10
Address: 10.152.183.10#53
Name: pg-master-0.pg-master-headless.postgres.svc.cluster.local
Address: 10.1.45.45
Here is my code
MASTER_HOST=$(nslookup pg-master-0.pg-master-headlesss | awk '/^Address:/ {A=$2}; END {print A}');
echo $MASTER_HOST
Unfortunately, my output is:
10.152.183.10#53
Here I'm logged into the pod
then ran the nslookup that way.