RabbitMQ - List Virtual Hosts using the rabbitmqctl list_vhosts command
by
Jeremy Canfield |
Updated: February 22 2022
| RabbitMQ articles
The list_vhosts option can be used to return the list of virtual hosts which should produce something like this.
~]$ rabbitmqctl list_vhosts
Listing vhosts ...
name
/
foo
bar
There are only two additional arguments that can be included, name and tracing. The tracing option will return either true or false.
~]$ rabbitmqctl list_vhosts name tracing
Listing vhosts ...
name tracing
/ false
foo false
bar false
The --quiet option can be used to suppress "Listing vhosts ..." from the output.
~]$ rabbitmqctl list_vhosts name tracing --quiet
name tracing
/ false
foo false
bar false
The --formatter json option can be used to return the output in JSON.
~]$ rabbitmqctl list_vhosts name tracing --quiet --formatter json
[
{"name":"/","tracing":false}
,{"name":"foo","tracing":false}
,{"name":"bar","tracing":false}
]
Did you find this article helpful?
If so, consider buying me a coffee over at