Forum Discussion
nitass
Dec 29, 2017Employee
when i try to use the command where i have configured ASM and SNAT, i get the below output VS_www.test.com,10.10.10.10:http,SNAT_POOL
can you try this?
i think the problem is the script grabs pool using "pool" keyword. unfortunately, snatpool also uses "pool" keyword. so, what i added is to assume the 1st "pool" keyword is pool configuration.
[root@ve13a:Active:In Sync] config tmsh list ltm virtual one-line |awk '{for(i=0;i<=NF;i++)if($i=="pool"){p=$(i+1);break}; print $3,$6,p}' |awk '{cmd="tmsh list ltm pool " $3 " one-line"; cmd|getline r; print $1,$2,$3,r}' |awk '{printf "%s,%s,%s",$1,$2,$3} {for(j=3;j<=NF;j++)if($j~/:/){printf ",%s",$j} {print ""}}'
bar,172.28.24.10:80,poola,200.200.200.101:80
baz,1.2.3.4:80,poolb,200.200.200.111:80,200.200.200.201:80