Forum Discussion
aj1
Sep 10, 2015Nimbostratus
Thank you Kevin. That worked like a charm. What would be the best way to parse the response table in
apiAnonymous
to display the inside address for the outside address sent in the request (that is cs-server-addr
). In the below output, I'd like to get the inside IP 172.25.52.251%4
.
$ curl -sk -u "admin:admin" -H "Content-Type: application/json" -X GET "https://x.x.x.x/mgmt/tm/sys/connection?options=ss-client-addr+197.72.208.78" | perl -pe 's/\\n/,\n/g'
{"kind":"tm:sys:connection:connectionstats","selfLink":"https://localhost/mgmt/tm/sys/connection?options=ss-client-addr+197.72.208.78&ver=11.6.0","apiRawValues":{"apiAnonymous":"Sys::Connections,
172.25.52.251%4:41334 69.28.57.177%4:10086 197.72.208.78:1142 69.28.57.177:10086 tcp 499 (slot/tmm: 1/0) none,
172.25.52.251%4:60179 193.235.206.82%4:4070 197.72.208.78:1043 193.235.206.82:4070 tcp 47 (slot/tmm: 1/0) none,
Total records returned: 2,
"}}