Skip to content

Send JSON records to streamview

In this tutorial, you send the records of a mock order system to streamview. The records are plain JSON. They are not CloudEvents, and they do not come from a broker. You tell streamview which fields to use, you find a payment outage, and you make the view live.

You need a terminal on macOS or Linux, with curl. You also need streamview. To install it, do step 1 of See your first events.

The streamview website has an example file. Print its first three lines:

curl -s https://www.eventcatalog.dev/tools/streamview/examples/orders.jsonl | head -n 3

The terminal shows three records, such as these:

{"name":"order.placed","at":"2026-12-03T08:15:22.200Z","orderId":"ord_1nex9rk","total":126.15,"currency":"GBP","country":"GB","items":2}
{"name":"stock.reserved","at":"2026-12-03T08:15:22.371Z","orderId":"ord_1nex9rk","warehouse":"LHR-1"}
{"name":"payment.authorized","at":"2026-12-03T08:15:22.936Z","orderId":"ord_1nex9rk","amount":126.15,"method":"card"}

Your records are different, because the website makes the file when you ask for it. The file has the records of the last 15 minutes, and its last record is from this moment.

streamview needs three facts about each record. Find them in the lines on your screen:

The fact The field in this file
The kind of event name
The time of the event at
The ID that the records of one order share orderId

Run this command:

curl -s https://www.eventcatalog.dev/tools/streamview/examples/orders.jsonl | streamview serve - \
--db tutorial.db --type-field name --time-field at --correlation-field orderId --open

The | character sends the output of curl to streamview. The - tells streamview to read that output. The three options give the three fields from step 2.

The terminal shows two lines, such as these:

streamview is live at http://localhost:4747 · send events to POST http://localhost:4747/events (Ctrl-C to stop)
-: end of input, 1865 events accepted, 0 rejected

Your browser opens the page.

Click the time range button at the top right. It has a clock icon. Then click All.

You see six lanes, one for each value of the name field. The view shows approximately 15 minutes.

The streamview page with six lanes. Three lanes have a gap at the same time, and a high bar after the gap.

In the example system, the payment service stops for 80 seconds in each interval of 10 minutes.

  1. Find the payment.authorized lane.
  2. Find the gap in this lane. During the gap, the lane has no bars.
  3. Look at the bar immediately after the gap. It is high, because the held payments come through together.
  4. Look at the order.shipped lane and the email.sent lane. They have the same gap.
  5. Look at the order.placed lane. It has no gap: customers continued to place orders.

You found a fault from the shape of the timeline. You did not read one record.

  1. Drag across approximately five seconds of the timeline. Each event is now one thin mark.
  2. Click a mark in the email.sent lane.

A panel opens on the right side. The trace in the panel shows five events: order.placed, stock.reserved, payment.authorized, order.shipped, and email.sent. A blue line on the timeline connects them.

streamview connected these records because they have the same orderId.

  1. Look at the JSON in the panel. The data field has the record as the file gave it.
  2. Press Escape to close the panel.

Some order.placed records give total as text and not as a number. streamview flags them.

  1. Click the time range button. Then click All.
  2. Find the amber bars in the order.placed lane.
  3. Press /. The search box opens a list.
  4. Select is, and then select violation.

The timeline now shows only the flagged events.

  1. Press Backspace in the empty search box to remove the filter.

The command from step 3 read the file one time. Now read it again and again.

  1. Go to the terminal. Press Ctrl-C to stop streamview.
  2. Run this command:
while true; do
curl -s https://www.eventcatalog.dev/tools/streamview/examples/orders.jsonl
sleep 5
done | streamview serve - \
--db tutorial.db --type-field name --time-field at --correlation-field orderId --open

The command gets the file at intervals of 5 seconds. Each time, most records are the same as before. streamview keeps one copy of each record, and adds only the new records.

  1. Go to the page that the browser opened. Look at the Live button. If its dot is not red, click the button.
  2. Move the pointer off the timeline.

New marks come in at the right side, in groups, at intervals of approximately 5 seconds.

  1. To stop, go to the terminal and press Ctrl-C.

streamview stored the events in the file tutorial.db, in the directory where you ran the command. Delete that file:

rm -f tutorial.db tutorial.db-shm tutorial.db-wal

You sent plain JSON records from a command to streamview, and you gave the three fields. You found an outage, followed one order, found records that are different, and made the view live.

The same steps work with your data, if a command can print it as JSON.

Next steps: