extracting the output using python
<p>How do i extract the required data from the output  and save it to a variable</p>

<p><strong>this is my program:</strong> </p>

<pre><code>import commands

cmd = curl -v -k -H "Content-Type: application/json" -X GET -u hitman:hitman &lt;https://test.com:8181/v1/config/sipregistrar

result = commands.getoutput(cmd)
print result
</code></pre>

<p>now run the programm : </p>

<p>python test25.py</p>

<p><strong>output :</strong> </p>

<pre><code>About to connect() to test.com port 8181 (#0)
Trying test.com...   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0connected
Connected to 50.50.50.201 (50.50.50.201) port 8181 (#0)
successfully set certificate verify locations:
HTTP/1.1 200 OK
Date: Tue, 05 Jun 2012 18:27:11 GMT
Server: Jetty(6.1.22)
Content-Type: application/json;charset=UTF-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=12buplms5odzt;Path=/config
Transfer-Encoding: chunked
Closing connection #0
 SSLv3, TLS alert, Client hello (1):
} [data not shown]
{"sip_domains":{"prefix":[{"name":""}],"domain":[{"name":"k200.com"},{"name":"zinga.com"},{"name":"rambo.com"}]},"sip_security":{"level":2},"sip_trusted_hosts":{"host":[]},"sip_proxy_mode":{"handle_requests":1}}
</code></pre>

<p>from this output , the params i require : </p>

<blockquote>
  <p>{"sip_domains":{"prefix":[{"name":""}],"domain":[{"name":"k200.com"},{"name":"zinga.com"},{"name":"rambo.com"}]},"sip_security":{"level":2},"sip_trusted_hosts":{"host":[]},"sip_proxy_mode":{"handle_requests":1}}</p>
</blockquote>

<p>How do i extract the above and save it to a variable ?</p>
