<div dir="ltr">You can pipe the json through jq.<div><br></div><div>See: <a href="https://stedolan.github.io/jq/tutorial">https://stedolan.github.io/jq/tutorial</a></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-10 11:17 GMT+01:00 Andriy Tovstik <span dir="ltr"><<a href="mailto:andriy.tovstik@gmail.com" target="_blank">andriy.tovstik@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr" class="m_4043528725062552382gmail_msg">Hi all!<div class="m_4043528725062552382gmail_msg"><br class="m_4043528725062552382gmail_msg"></div><div class="m_4043528725062552382gmail_msg">During LXD learning i encountered with lack of some features.</div><div class="m_4043528725062552382gmail_msg"><br class="m_4043528725062552382gmail_msg"></div><div class="m_4043528725062552382gmail_msg">The first one is "raw" output format of lxc list. Currently lxc list supports two formats: table and json. Unfortunately both formats are unusable for scripting.</div><div class="m_4043528725062552382gmail_msg">It is very difficult to pass to script output likes:</div><div class="m_4043528725062552382gmail_msg"><div class="m_4043528725062552382gmail_msg"># lxc list --format table -c n</div><div class="m_4043528725062552382gmail_msg"><font face="monospace">+------------+</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">| NAME |</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">+------------+</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">| mysql-rep1 |</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">+------------+</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">| mysql-rep2 |</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">+------------+</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">| mysql-rep3 |</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace">+------------+</font></div><div class="m_4043528725062552382gmail_msg"><font face="monospace"><br></font></div><div class="m_4043528725062552382gmail_msg">When i try to use json format i see that useful fields like container name are missing in output. May be it will be useful to implement feature like:</div><div class="m_4043528725062552382gmail_msg"><br></div><div><div class="m_4043528725062552382gmail_msg"># lxc list --format raw -c n --no-header</div><div class="m_4043528725062552382gmail_msg"><span style="font-family:monospace">mysql-rep1</span><br></div><div class="m_4043528725062552382gmail_msg"><span style="font-family:monospace">mysql-rep2</span><br></div><div class="m_4043528725062552382gmail_msg"><span style="font-family:monospace">mysql-rep3</span><br></div><div class="m_4043528725062552382gmail_msg"><br></div></div><div class="m_4043528725062552382gmail_msg">The second feature looks useful is ability run commands on multiplie containers simultaneously. For example:</div><div class="m_4043528725062552382gmail_msg"><br></div><div class="m_4043528725062552382gmail_msg"><div class="m_4043528725062552382gmail_msg"># lxc exec web-node* -- apt update</div><div><br></div><div>What do you think about it?<span class="HOEnZb"><font color="#888888"><br></font></span></div></div></div></div></div><span class="HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">WBR, Andriy Tovstik</div></div>
</font></span><br>______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.<wbr>linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.<wbr>org/listinfo/lxc-users</a><br></blockquote></div><br></div>