Why a terminal is not enough
The usual way to look at MQTT is mosquitto_sub -v -t '#' in a terminal. It prints each message as it arrives.
With many devices, the terminal scrolls faster than you can read.
When something is wrong, you ask different questions:
- Which devices are sending at this moment, and which device stopped?
- When did it stop, and what did it send when it came back?
- Did a firmware update change what a device sends?
These are questions about time. A picture of time gives the answer faster than a scrolling terminal.
streamview draws time from left to right, and gives each topic one lane. One message is one thin mark. When you zoom out, many messages become a bar, and a taller bar means more messages. All lanes use the same clock, so you can compare one topic with a different topic.
What you see on the timeline
The screenshots on this page are from a real Mosquitto broker.
They show a small example factory: temperature and vibration sensors on two lines, a press, and production batches that go through three steps.
The example is in the example-mqtt directory of the streamview repository.
A device that stops has a shape
In this example, the temperature sensor of line 2 goes offline for one minute. When it comes back, it sends the readings that it kept.

You did not write a query to find this, and you did not read a message. The gap and the burst are visible as soon as you look at the page.
A changed payload is amber
A firmware update on line 1 sent the celsius field as text, for example "22.4 C", not as a number.
streamview compares only the fields at the top level of a message, and mosquitto_sub puts the payload one level down, in payload.
To compare the fields of the payload, put jq between the two commands. It moves the fields of the payload to the top level, and keeps the topic:
mosquitto_sub -h localhost -t '#' -F '%J' -R \ | jq -c --unbuffered '{topic} + (.payload | if type == "object" then . else {payload: .} end)' \ | streamview serve - --type-field topic --correlation-field batchId
streamview learns the usual fields of each topic from its first 20 messages. You do not give it a schema. A message with a missing field, a new field, or a field of a different type gets a flag. How streamview flags an event has the details.
One batch goes through many topics
Click a message. streamview finds all messages that have the same correlation ID, on all topics.

mosquitto_sub puts the payload in the payload field. Thus the option is --correlation-field payload.batchId.
Get started
You need macOS or Linux, and mosquitto_sub. It is in the Mosquitto package:
brew install mosquittoOn Debian and Ubuntu, the package is mosquitto-clients.
- Install streamviewcurl -fsSL https://github.com/event-catalog/streamview/releases/latest/download/install.sh | sh
- Pipe all topics into streamviewmosquitto_sub -h localhost -t '#' -F '%J' -R | streamview serve - --type-field topic
Change
localhostto the address of your broker. - Look at your topics
Open
http://localhost:4747. Drag across the timeline to zoom in, and click a mark to open a message.
Each part of the command has a purpose:
| Part | What it does |
|---|---|
-t '#' |
Subscribes to all topics. The $SYS topics of the broker are not included. Use a narrower filter, for example factory/#, to read fewer topics. |
-F '%J' |
Prints each message as one JSON object, with the topic, the time, the QoS, and the payload. A payload that is JSON becomes an object. |
-R |
Does not print the old retained messages. |
--type-field topic |
Makes one lane from each topic. |
--correlation-field payload.batchId |
Connects the messages that have the same value in this field of the payload. |
To try it with the example factory of this page, you need Docker:
git clone https://github.com/event-catalog/streamviewcd streamview/example-mqttdocker compose up -ddocker compose exec -T mosquitto mosquitto_sub -t '#' -F '%J' -R | streamview serve - --type-field topic --correlation-field payload.batchIdThe last command uses the mosquitto_sub of the container, so you do not need to install it.
Is it safe to connect it to a real broker?
streamview only reads, and mosquitto_sub is a usual subscriber.
An MQTT broker sends a copy of each message to each subscription that matches its topic. mosquitto_sub is not part of a shared subscription, so your subscribers get their messages as before. It uses a clean session by default, so the broker keeps nothing for it after it stops.
There are limits that you must know before you connect it to production:
- The page has no login. Each person who can open it can read all messages. By default, it accepts connections only from your computer.
- MQTT has no history. streamview shows only the messages that arrive after you start the command.
- streamview reads JSON. mosquitto_sub skips a payload that is not JSON, and streamview does not decode Sparkplug B, Protobuf, or other binary payloads.
- Each topic is one lane. If your topics contain device IDs, shorten them with
jq, as in the questions below.
Show events from any command and Limits have more details.
What happens, and what must happen
A timeline shows what happens on your topics. It does not tell you what must happen:
- What is this topic for?
- Which devices and services publish to it, and which subscribe to it?
- Which payload must its messages have, and who owns it?
Those answers are documentation. For that, the same team makes EventCatalog, an open source tool that documents an event-driven architecture: the events, the channels such as MQTT topics, the services, the schemas, and the owners. EventCatalog also draws the architecture from that documentation, and it has an AsyncAPI integration.
The two views go together. The catalog tells you that the line 2 sensor sends a reading every few seconds. The timeline shows you that today, for one minute, it sent nothing.
streamview shows your topics in real time. EventCatalog documents them: what each topic is for, which devices and services use it, and who owns it.
Go to eventcatalog.devQuestions and answers
How do I visualize MQTT topics?
Install streamview and mosquitto_sub, then run mosquitto_sub -h localhost -t '#' -F '%J' -R | streamview serve - --type-field topic. Open http://localhost:4747. Each topic is one lane on a live timeline. You do not write a schema.
Does streamview have an MQTT adapter?
No. streamview reads each command that prints JSON objects, one on each line. mosquitto_sub -F '%J' prints each MQTT message in that form, with the topic, the QoS, and the payload. Thus mosquitto_sub does the MQTT part, and streamview does the timeline.
Does it work with my broker?
It works with each broker that mosquitto_sub can connect to, because streamview does not connect to the broker itself. We tested it with Mosquitto 2. mosquitto_sub has options for a port, a login, and TLS, for example -p, -u, -P, and --cafile. The mosquitto_sub manual has all options.
Does it take messages from my subscribers?
No. An MQTT broker sends a copy of each message to each subscription that matches its topic, and mosquitto_sub makes a usual subscription. It is not part of a shared subscription. By default it uses a clean session, so the broker does not keep messages for it after it stops.
Does it show old messages?
No. MQTT does not keep a history, so streamview shows the messages that arrive after you start the command. A broker keeps one retained message for each topic. -R tells mosquitto_sub not to print these old messages, because streamview would show them at the time of the start.
Which time does streamview give each message?
The time when the message arrives at streamview. For a live subscription, that is the time when the broker sent it. If your payload has its own time field, for example ts, add --time-field payload.ts.
My topics contain device IDs. Do I get one lane for each device?
Yes, unless you shorten the topic first. Put jq between the two commands, for example jq -c --unbuffered '.topic |= (split("/")[0:2] | join("/"))'. This keeps the first two parts of each topic. The full message stays in the event.
What happens to a payload that is not JSON?
With -F '%J', mosquitto_sub does not print a message whose payload is not JSON. It prints an error in the terminal, and continues with the next message. Thus streamview does not show these messages. It does not decode Sparkplug B, Protobuf, or other binary payloads.
Does streamview flag a changed payload?
Yes, but it compares only the fields at the top level of a message, and mosquitto_sub puts the payload in the payload field. Put jq between the two commands to move the fields of the payload to the top level. The section about a changed payload on this page has the command.
What is the difference between streamview and EventCatalog?
streamview shows the messages on your topics in real time. EventCatalog documents your architecture, which includes what each topic is for, which devices and services use it, and who owns it. The same team makes both, and both are open source.
Where to go next
How streamview reads the output of a command, with more recipes for logs, containers, and databases.
Send JSON records to streamviewA tutorial with an example file of plain JSON records. You learn the options that map the fields.
Event formatHow streamview makes an event from a plain JSON record, and which fields it uses.
Follow one orderConnect the messages of one batch across topics, and send the trace to a different person.
More guides: Visualize Kafka topics, Visualize NATS subjects
