LogoLogo
2.1.0
2.1.0
  • Welcome
  • Getting Started
  • Downloads
  • VerneMQ / MQTT Introduction
  • Installing VerneMQ
    • Installing on Debian and Ubuntu
    • Installing on CentOS and RHEL
    • Running VerneMQ using Docker
  • Configuring VerneMQ
    • Introduction
    • The VerneMQ conf file
    • Schema Files
    • Auth using files
    • Auth using a database
    • MQTT Options
    • MQTT Listeners
    • HTTP Listeners
    • Non-standard MQTT options
    • Websockets
    • Logging
    • Consumer session balancing
    • Plugins
    • Shared subscriptions
    • Advanced Options
    • Storage
    • MQTT Bridge
    • REST Publisher
  • VerneMQ Clustering
    • Introduction
    • Inter-node Communication
    • Dealing with Netsplits
  • Live Administration
    • Introduction
    • Inspecting and managing sessions
    • Retained messages
    • Live reconfiguration
    • Managing Listeners
    • Certificate Management
    • HTTP API
    • Tracing
    • Output Format
  • Monitoring
    • Introduction
    • $SYSTree
    • Graphite
    • Netdata
    • Prometheus
    • Health Checker
    • Status Page
  • Plugin Development
    • Introduction
    • Session lifecycle
    • Subscribe Flow
    • Publish Flow
    • Enhanced Auth Flow
    • Erlang Boilerplate
    • Lua Scripting Support
    • Webhooks
  • Misc
    • Loadtesting VerneMQ
    • Not a tuning guide
    • Change Open File Limits
  • Guides
    • A typical VerneMQ deployment
    • VerneMQ on Kubernetes
    • Loadtesting VerneMQ
    • Clustering during development
    • Not a tuning guide
    • Change Open File Limits
    • Migrating to 2.0
Powered by GitBook
On this page
  • Default Output Format
  • JSON Output Format

Was this helpful?

Edit on GitHub
Export as PDF
  1. Live Administration

Output Format

Changing the output format of CLI commands

Default Output Format

The default output format is called human-readable. It will print tables or text answers in response to your CLI commands.

JSON Output Format

The only alternative format is JSON. You can request it by adding the --format=json key to a command.

vmq-admin listener show --format=json
{"table":[{"type":"vmq","status":"running","address":"0.0.0.0","port":"44053","mountpoint":"","max_conns":10000,"active_conns":0,"all_conns":0},{"type":"mqtt","status":"running","address":"127.0.0.1","port":"1883","mountpoint":"","max_conns":10000,"active_conns":0,"all_conns":0},{"type":"mqttws","status":"running","address":"127.0.0.1","port":"1887","mountpoint":"","max_conns":10000,"active_conns":0,"all_conns":0},{"type":"http","status":"running","address":"127.0.0.1","port":"8888","mountpoint":"","max_conns":10000,"active_conns":0,"all_conns":0}],"type":"table"}%

To pretty-print your JSON or extract the table object, use the jq command. Currently, not all responses give you a nice table and attributes format. Namely, vmq-admin metrics show will only give the metrics as text.

vmq-admin listener show --format=json | jq '.table'
[
  {
    "type": "vmq",
    "status": "running",
    "address": "0.0.0.0",
    "port": "44053",
    "mountpoint": "",
    "max_conns": 10000,
    "active_conns": 0,
    "all_conns": 0
  },
  {
    "type": "mqtt",
    "status": "running",
    "address": "127.0.0.1",
    "port": "1883",
    "mountpoint": "",
    "max_conns": 10000,
    "active_conns": 0,
    "all_conns": 0
  },
  {
    "type": "mqttws",
    "status": "running",
    "address": "127.0.0.1",
    "port": "1887",
    "mountpoint": "",
    "max_conns": 10000,
    "active_conns": 0,
    "all_conns": 0
  },
  {
    "type": "http",
    "status": "running",
    "address": "127.0.0.1",
    "port": "8888",
    "mountpoint": "",
    "max_conns": 10000,
    "active_conns": 0,
    "all_conns": 0
  }
]
PreviousTracingNextIntroduction

Last updated 6 days ago

Was this helpful?