Connect to a live stream
A live stream shows messages as they arrive: lines added to a log file, or messages from a WebSocket or Server-Sent Events (SSE) endpoint. Each message is a row you can expand. To search, query, or chart the messages, freeze the stream into a document.
Stream sources
Section titled “Stream sources”| Source | Connects to | One message is |
|---|---|---|
| File tail | A file on your computer that another program appends to | One line |
| WebSocket | A ws:// or wss:// address |
One text message |
| Server-Sent Events | An http:// or https:// address |
One event |
A message does not have to be JSON. Messages that are not valid JSON show dimmed and cannot be expanded.
File tail starts with the last lines of the file, then shows each new line as it is written. If the file is deleted, the stream waits for it to come back; when a log is rotated, the stream continues from the start of the new file.
WebSocket and Server-Sent Events reconnect on their own when the connection drops, waiting a little longer after each failed attempt, up to 30 seconds.
Connect to a source
Section titled “Connect to a source”-
Choose File → Connect to Live Stream…, or run Connect to Live Stream… from the command palette.
-
Choose the Source: File tail, WebSocket, or Server-Sent Events.
-
For File tail, type the path in File or select Browse…. For the other sources, type the URL, and add Authentication and Headers if the server needs them.
-
Optional: change the Buffer size, the number of messages kept. It is 5,000 by default and can be set from 100 to 100,000.
-
Select Connect, or press Ctrl+Enter.
The stream opens in a new tab named tail: <file name> for a file, or after its URL. If you saved credentials for the URL with Fetch from URL, they are filled in when you leave the URL field. The stream dialog never saves credentials itself.
Read the stream
Section titled “Read the stream”The Stream view lists the messages with the time each one arrived. Click a JSON message to expand it into a small tree. A very long message is cut short in the list, marked “message truncated”, and cannot be expanded.
The toolbar above the list shows:
- The connection status: Connecting…, Live, Reconnecting (attempt N)…, Waiting for file…, Disconnected, or an error. Hover over an error to read it.
- The number of messages received, and how many were dropped from the buffer once it was full. The oldest messages are dropped first.
The list scrolls to the newest message every time one arrives. To read older messages, pause the stream.
Pause, resume, and disconnect
Section titled “Pause, resume, and disconnect”- Pause stops updating the list, so you can scroll and read. Messages keep arriving in the background, up to the buffer size. Resume adds them to the list.
- Disconnect stops the stream. The tab stays open with the messages it shows.
- Closing the tab disconnects the stream. Quitting JSON Digger disconnects every stream.
Freeze a stream into a document
Section titled “Freeze a stream into a document”Freeze stops the stream and opens its messages as an NDJSON document, one message per line. The live tab closes, and a notice confirms “Stream frozen into a document”.
Freeze while the stream is still connected, not after Disconnect. The frozen document holds the messages in the buffer, including those received while the stream was paused, but not those already dropped from the buffer.
JSON Digger deletes a frozen document the next time it starts, once the document is more than a day old. It opens in the Tree, NDJSON, Table, and Chart views, and you can search, query, and chart it like any NDJSON file. It cannot be edited. To keep it, press Ctrl+Shift+S or choose File → Save As….
What works on a live stream
Section titled “What works on a live stream”A live stream tab is for watching: it shows, pauses, and freezes messages. Search, queries, SQL, editing, and the panels need a document, so freeze the stream first. Find in All Open Tabs skips stream tabs.
For the limits of a stream, see Limits.