Forum Discussion
aj1
Nimbostratus
Aug 14, 2015tmsh show /sys connection cs-client-addr x.x.x.x using iControl REST
Been going through the iControl REST reference and it appears appending stats to the GET request outputs the tmsh show ... of a pool, virtual etc. I've tried the same approach for tmsh show...
Kevin_Stewart
Employee
Sep 10, 2015Okay, for the sake of testing I just rebuilt the whole thing:
import re
import subprocess
p1 = subprocess.Popen([
'curl',
'-sk',
'-u',
'admin:admin',
'-H','Content-Type: application/json',
'-H','Accept: application/json',
'-X','GET',
'https://x.x.x.x/mgmt/tm/sys/connection'
],stdout=subprocess.PIPE)
p2 = subprocess.Popen([
'perl',
'-pe',
'\'s/\\n/,\n/g\''
],stdin=p1.stdout,stdout=subprocess.PIPE)
result = str(p2.communicate()).split('\\n')
for line in result:
if re.search('^[0-9].*', line) is not None:
ip = line.split(" ")
print ip[0]
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
